Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/ip_input.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet/ip_input.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.250 retrieving revision 1.250.4.3 diff -u -p -r1.250 -r1.250.4.3 --- src/sys/netinet/ip_input.c 2007/07/19 20:48:55 1.250 +++ src/sys/netinet/ip_input.c 2007/10/02 18:29:19 1.250.4.3 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.250 2007/07/19 20:48:55 dyoung Exp $ */ +/* $NetBSD: ip_input.c,v 1.250.4.3 2007/10/02 18:29:19 joerg Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.250 2007/07/19 20:48:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.250.4.3 2007/10/02 18:29:19 joerg Exp $"); #include "opt_inet.h" #include "opt_gateway.h" @@ -1013,7 +1013,6 @@ found: /* XXX error stat??? */ error = EINVAL; DPRINTF(("ip_input: no SP, packet discarded\n"));/*XXX*/ - goto bad; } splx(s); if (error) @@ -2079,13 +2078,12 @@ ip_savecontrol(struct inpcb *inp, struct if (inp->inp_flags & INP_RECVIF) { struct sockaddr_dl sdl; - sdl.sdl_len = offsetof(struct sockaddr_dl, sdl_data[0]); - sdl.sdl_family = AF_LINK; - sdl.sdl_index = m->m_pkthdr.rcvif ? - m->m_pkthdr.rcvif->if_index : 0; - sdl.sdl_nlen = sdl.sdl_alen = sdl.sdl_slen = 0; - *mp = sbcreatecontrol((void *) &sdl, sdl.sdl_len, - IP_RECVIF, IPPROTO_IP); + sockaddr_dl_init(&sdl, sizeof(sdl), + (m->m_pkthdr.rcvif != NULL) + ? m->m_pkthdr.rcvif->if_index + : 0, + 0, NULL, 0, NULL, 0); + *mp = sbcreatecontrol(&sdl, sdl.sdl_len, IP_RECVIF, IPPROTO_IP); if (*mp) mp = &(*mp)->m_next; }