FreeBSD Bugzilla – Attachment 232735 Details for
Bug 262828
[carp] CARP arp replays with wrong src mac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
3ea67e2cd8.patch (text/plain), 1.65 KB, created by
Ivan Rozhuk
on 2022-03-26 13:08:47 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Ivan Rozhuk
Created:
2022-03-26 13:08:47 UTC
Size:
1.65 KB
patch
obsolete
>From 3ea67e2cd81dc6137a0a85deabce86e5fbe0aaa2 Mon Sep 17 00:00:00 2001 >From: Rozhuk Ivan <rozhuk.im@gmail.com> >Date: Sat, 26 Mar 2022 12:28:14 +0300 >Subject: [PATCH] CARP: set CARP mac address as src in ethernet header of ARP > packet > >--- > sys/net/if_ethersubr.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > >diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c >index 25daf13ccef..547d6d09514 100644 >--- a/sys/net/if_ethersubr.c >+++ b/sys/net/if_ethersubr.c >@@ -146,7 +146,7 @@ ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) > struct ether_header *eh; > struct arphdr *ah; > uint16_t etype; >- const u_char *lladdr; >+ const u_char *lladdr, *llsaddr; > > if (req->rtype != IFENCAP_LL) > return (EOPNOTSUPP); >@@ -155,6 +155,7 @@ ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) > return (ENOMEM); > > eh = (struct ether_header *)req->buf; >+ llsaddr = IF_LLADDR(ifp); > lladdr = req->lladdr; > req->lladdr_off = 0; > >@@ -180,7 +181,11 @@ ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) > etype = htons(ETHERTYPE_ARP); > break; > } >- >+#if defined(INET) >+ /* Set CARP MAC as src ethernet address. */ >+ if (ifp->if_carp) >+ llsaddr = ar_sha(ah); >+#endif > if (req->flags & IFENCAP_FLAG_BROADCAST) > lladdr = ifp->if_broadcastaddr; > break; >@@ -190,7 +195,7 @@ ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) > > memcpy(&eh->ether_type, &etype, sizeof(eh->ether_type)); > memcpy(eh->ether_dhost, lladdr, ETHER_ADDR_LEN); >- memcpy(eh->ether_shost, IF_LLADDR(ifp), ETHER_ADDR_LEN); >+ memcpy(eh->ether_shost, llsaddr, ETHER_ADDR_LEN); > req->bufsize = sizeof(struct ether_header); > > return (0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262828
:
232735
|
244151