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.275.2.2 retrieving revision 1.278 diff -u -p -r1.275.2.2 -r1.278 --- src/sys/netinet/ip_input.c 2009/04/28 07:37:22 1.275.2.2 +++ src/sys/netinet/ip_input.c 2009/01/19 02:27:57 1.278 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.275.2.2 2009/04/28 07:37:22 skrll Exp $ */ +/* $NetBSD: ip_input.c,v 1.278 2009/01/19 02:27:57 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.275.2.2 2009/04/28 07:37:22 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.278 2009/01/19 02:27:57 christos Exp $"); #include "opt_inet.h" #include "opt_compat_netbsd.h" @@ -1562,7 +1562,7 @@ ip_dooptions(struct mbuf *m) /* * locate outgoing interface */ - memcpy((void *)&ipaddr.sin_addr, (void *)(cp + off), + bcopy((void *)(cp + off), (void *)&ipaddr.sin_addr, sizeof(ipaddr.sin_addr)); if (opt == IPOPT_SSRR) ia = ifatoia(ifa_ifwithladdr(sintosa(&ipaddr))); @@ -1598,7 +1598,7 @@ ip_dooptions(struct mbuf *m) off--; /* 0 origin */ if ((off + sizeof(struct in_addr)) > optlen) break; - memcpy((void *)&ipaddr.sin_addr, (void *)(&ip->ip_dst), + bcopy((void *)(&ip->ip_dst), (void *)&ipaddr.sin_addr, sizeof(ipaddr.sin_addr)); /* * locate outgoing interface; if we're the destination, @@ -1665,7 +1665,7 @@ ip_dooptions(struct mbuf *m) (u_char *)ip; goto bad; } - memcpy(&ipaddr.sin_addr, cp0, + bcopy(cp0, &ipaddr.sin_addr, sizeof(struct in_addr)); if (ifatoia(ifa_ifwithaddr(sintosa(&ipaddr))) == NULL) @@ -1739,7 +1739,7 @@ save_rte(u_char *option, struct in_addr #endif /* 0 */ if (olen > sizeof(ip_srcrt) - (1 + sizeof(dst))) return; - memcpy((void *)ip_srcrt.srcopt, (void *)option, olen); + bcopy((void *)option, (void *)ip_srcrt.srcopt, olen); ip_nhops = (olen - IPOPT_OFFSET - 1) / sizeof(struct in_addr); ip_srcrt.dst = dst; } @@ -2136,10 +2136,9 @@ sysctl_net_inet_ip_forwsrcrt(SYSCTLFN_AR if (error || newp == NULL) return (error); - error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_FORWSRCRT, - 0, NULL, NULL, NULL); - if (error) - return (error); + if (kauth_authorize_network(l->l_cred, KAUTH_NETWORK_FORWSRCRT, + 0, NULL, NULL, NULL)) + return (EPERM); ip_forwsrcrt = tmp;