Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F270955
d4004_kernel.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
melifaro
Oct 26 2015, 11:12 PM
2015-10-26 23:12:48 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
d4004_kernel.diff
View Options
Index: sys/net/if.c
===================================================================
--- sys/net/if.c (revision 289450)
+++ sys/net/if.c (working copy)
@@ -3315,7 +3315,7 @@ if_delmulti_locked(struct ifnet *ifp, struct ifmul
* At this time we only support certain types of interfaces,
* and we don't allow the length of the address to change.
*/
-int
+__noinline int
if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len)
{
struct sockaddr_dl *sdl;
Index: sys/net/if_lagg.c
===================================================================
--- sys/net/if_lagg.c (revision 289450)
+++ sys/net/if_lagg.c (working copy)
@@ -730,7 +754,7 @@ lagg_port_create(struct lagg_softc *sc, struct ifn
}
/* XXX Disallow non-ethernet interfaces (this should be any of 802) */
- if (ifp->if_type != IFT_ETHER)
+ if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN)
return (EPROTONOSUPPORT);
/* Allow the first Ethernet member to define the MTU */
Index: sys/netinet/if_ether.c
===================================================================
--- sys/netinet/if_ether.c (revision 289450)
+++ sys/netinet/if_ether.c (working copy)
@@ -144,7 +144,9 @@ static void arp_check_update_lle(struct arphdr *ah
static void arp_update_lle(struct arphdr *ah, struct ifnet *ifp,
struct llentry *la);
static void arp_mark_lle_reachable(struct llentry *la);
+static void arp_iflladdr(void *arg __unused, struct ifnet *ifp);
+static eventhandler_tag iflladdr_tag;
static const struct netisr_handler arp_nh = {
.nh_name = "arp",
@@ -1163,10 +1165,35 @@ arp_ifinit2(struct ifnet *ifp, struct ifaddr *ifa,
ifa->ifa_rtrequest = NULL;
}
+/*
+ * A handler for interface link layer address change event.
+ */
+static __noinline void
+arp_iflladdr(void *arg __unused, struct ifnet *ifp)
+{
+ struct ifaddr *ifa;
+
+ if ((ifp->if_flags & IFF_UP) == 0)
+ return;
+
+ return;
+
+ /*
+ * Also send gratuitous ARPs to notify other nodes about
+ * the address change.
+ */
+ TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+ if (ifa->ifa_addr->sa_family == AF_INET)
+ arp_ifinit(ifp, ifa);
+ }
+}
+
static void
arp_init(void)
{
netisr_register(&arp_nh);
+ iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event,
+ arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY);
}
SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0);
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
267327
Default Alt Text
d4004_kernel.diff (2 KB)
Attached To
Mode
D4004: Yet another if_lagg lladdr/eventhandler fix.
Attached
Detach File
Event Timeline
melifaro
added a comment.
Oct 26 2015, 11:13 PM
2015-10-26 23:13:10 (UTC+0)
Comment Actions
Small hacks for dtrace/tests in
D4004
Log In to Comment