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/net/if_spppsubr.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/net/if_spppsubr.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.131 retrieving revision 1.131.2.1 diff -u -p -r1.131 -r1.131.2.1 --- src/sys/net/if_spppsubr.c 2014/11/28 08:29:00 1.131 +++ src/sys/net/if_spppsubr.c 2015/06/06 14:40:25 1.131.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: if_spppsubr.c,v 1.131 2014/11/28 08:29:00 ozaki-r Exp $ */ +/* $NetBSD: if_spppsubr.c,v 1.131.2.1 2015/06/06 14:40:25 skrll Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. @@ -41,11 +41,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.131 2014/11/28 08:29:00 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.131.2.1 2015/06/06 14:40:25 skrll Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" -#include "opt_ipx.h" #include "opt_modular.h" #include "opt_compat_netbsd.h" #endif @@ -85,11 +84,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_spppsubr. #include #endif -#ifdef IPX -#include -#include -#endif - #include #include @@ -548,12 +542,6 @@ sppp_input(struct ifnet *ifp, struct mbu pktq = ip6_pktq; break; #endif -#ifdef IPX - case ETHERTYPE_IPX: - isr = NETISR_IPX; - inq = &ipxintrq; - break; -#endif } goto queue_pkt; default: /* Invalid PPP packet. */ @@ -624,15 +612,6 @@ sppp_input(struct ifnet *ifp, struct mbu } break; #endif -#ifdef IPX - case PPP_IPX: - /* IPX IPXCP not implemented yet */ - if (sp->pp_phase == SPPP_PHASE_NETWORK) { - isr = NETISR_IPX; - inq = &ipxintrq; - } - break; -#endif } queue_pkt: @@ -829,12 +808,6 @@ sppp_output(struct ifnet *ifp, struct mb } break; #endif -#ifdef IPX - case AF_IPX: /* Novell IPX Protocol */ - protocol = htons((sp->pp_flags & PP_CISCO) ? - ETHERTYPE_IPX : PPP_IPX); - break; -#endif default: m_freem(m); ++ifp->if_oerrors; @@ -1017,12 +990,14 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd { struct lwp *l = curlwp; /* XXX */ struct ifreq *ifr = (struct ifreq *) data; + struct ifaddr *ifa = (struct ifaddr *) data; struct sppp *sp = (struct sppp *) ifp; int s, error=0, going_up, going_down, newmode; s = splnet(); switch (cmd) { case SIOCINITIFADDR: + ifa->ifa_rtrequest = p2p_rtrequest; break; case SIOCSIFFLAGS: @@ -4873,7 +4848,7 @@ sppp_set_ip_addrs(struct sppp *sp, uint3 found: { - int error; + int error, hostIsNew; struct sockaddr_in new_sin = *si; struct sockaddr_in new_dst = *dest; @@ -4884,8 +4859,13 @@ found: */ in_ifscrub(ifp, ifatoia(ifa)); - if (myaddr != 0) - new_sin.sin_addr.s_addr = htonl(myaddr); + hostIsNew = 0; + if (myaddr != 0) { + if (new_sin.sin_addr.s_addr != htonl(myaddr)) { + new_sin.sin_addr.s_addr = htonl(myaddr); + hostIsNew = 1; + } + } if (hisaddr != 0) { new_dst.sin_addr.s_addr = htonl(hisaddr); if (new_dst.sin_addr.s_addr != dest->sin_addr.s_addr) { @@ -4893,7 +4873,7 @@ found: *dest = new_dst; /* fix dstaddr in place */ } } - error = in_ifinit(ifp, ifatoia(ifa), &new_sin, 0); + error = in_ifinit(ifp, ifatoia(ifa), &new_sin, 0, hostIsNew); if (debug && error) { log(LOG_DEBUG, "%s: sppp_set_ip_addrs: in_ifinit " @@ -4946,7 +4926,7 @@ found: if (sp->ipcp.flags & IPCP_HISADDR_DYN) /* replace peer addr in place */ dest->sin_addr.s_addr = sp->ipcp.saved_hisaddr; - in_ifinit(ifp, ifatoia(ifa), &new_sin, 0); + in_ifinit(ifp, ifatoia(ifa), &new_sin, 0, 0); (void)pfil_run_hooks(if_pfil, (struct mbuf **)SIOCDIFADDR, ifp, PFIL_IFADDR); }