View | Details | Raw Unified | Return to bug 262828 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/net/if_ethersubr.c (-3 / +13 lines)
Lines 97-102 CTASSERT(sizeof (struct ether_addr) == ETHER_ADDR_LEN); Link Here
97
97
98
VNET_DEFINE(pfil_head_t, link_pfil_head);	/* Packet filter hooks */
98
VNET_DEFINE(pfil_head_t, link_pfil_head);	/* Packet filter hooks */
99
99
100
#ifdef INET
101
VNET_DECLARE(bool, use_carp_src_mac_in_arp);
102
#define	V_use_carp_src_mac VNET(use_carp_src_mac_in_arp)
103
#endif
104
100
/* netgraph node hooks for ng_ether(4) */
105
/* netgraph node hooks for ng_ether(4) */
101
void	(*ng_ether_input_p)(struct ifnet *ifp, struct mbuf **mp);
106
void	(*ng_ether_input_p)(struct ifnet *ifp, struct mbuf **mp);
102
void	(*ng_ether_input_orphan_p)(struct ifnet *ifp, struct mbuf *m);
107
void	(*ng_ether_input_orphan_p)(struct ifnet *ifp, struct mbuf *m);
Lines 146-152 ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) Link Here
146
	struct ether_header *eh;
151
	struct ether_header *eh;
147
	struct arphdr *ah;
152
	struct arphdr *ah;
148
	uint16_t etype;
153
	uint16_t etype;
149
	const u_char *lladdr;
154
	const u_char *lladdr, *llsaddr;
150
155
151
	if (req->rtype != IFENCAP_LL)
156
	if (req->rtype != IFENCAP_LL)
152
		return (EOPNOTSUPP);
157
		return (EOPNOTSUPP);
Lines 155-160 ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) Link Here
155
		return (ENOMEM);
160
		return (ENOMEM);
156
161
157
	eh = (struct ether_header *)req->buf;
162
	eh = (struct ether_header *)req->buf;
163
	llsaddr = IF_LLADDR(ifp);
158
	lladdr = req->lladdr;
164
	lladdr = req->lladdr;
159
	req->lladdr_off = 0;
165
	req->lladdr_off = 0;
160
166
Lines 180-186 ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) Link Here
180
			etype = htons(ETHERTYPE_ARP);
186
			etype = htons(ETHERTYPE_ARP);
181
			break;
187
			break;
182
		}
188
		}
183
189
#ifdef INET
190
		/* Set CARP MAC as src ethernet address. */
191
		if (ifp->if_carp && V_use_carp_src_mac)
192
			llsaddr = ar_sha(ah);
193
#endif
184
		if (req->flags & IFENCAP_FLAG_BROADCAST)
194
		if (req->flags & IFENCAP_FLAG_BROADCAST)
185
			lladdr = ifp->if_broadcastaddr;
195
			lladdr = ifp->if_broadcastaddr;
186
		break;
196
		break;
Lines 190-196 ether_requestencap(struct ifnet *ifp, struct if_encap_req *req) Link Here
190
200
191
	memcpy(&eh->ether_type, &etype, sizeof(eh->ether_type));
201
	memcpy(&eh->ether_type, &etype, sizeof(eh->ether_type));
192
	memcpy(eh->ether_dhost, lladdr, ETHER_ADDR_LEN);
202
	memcpy(eh->ether_dhost, lladdr, ETHER_ADDR_LEN);
193
	memcpy(eh->ether_shost, IF_LLADDR(ifp), ETHER_ADDR_LEN);
203
	memcpy(eh->ether_shost, llsaddr, ETHER_ADDR_LEN);
194
	req->bufsize = sizeof(struct ether_header);
204
	req->bufsize = sizeof(struct ether_header);
195
205
196
	return (0);
206
	return (0);
(-)b/sys/netinet/ip_carp.c (+12 lines)
Lines 214-219 VNET_DEFINE_STATIC(int, carp_senderr_adj) = CARP_MAXSKEW; Link Here
214
VNET_DEFINE_STATIC(int, carp_ifdown_adj) = CARP_MAXSKEW;
214
VNET_DEFINE_STATIC(int, carp_ifdown_adj) = CARP_MAXSKEW;
215
#define	V_carp_ifdown_adj	VNET(carp_ifdown_adj)
215
#define	V_carp_ifdown_adj	VNET(carp_ifdown_adj)
216
216
217
/* Use CARP MAC as src addr in ethernet header of ARP packets.*/
218
#ifdef INET
219
VNET_DEFINE(bool, use_carp_src_mac_in_arp) = false;
220
#define	V_use_carp_src_mac VNET(use_carp_src_mac_in_arp)
221
#endif
222
217
static int carp_allow_sysctl(SYSCTL_HANDLER_ARGS);
223
static int carp_allow_sysctl(SYSCTL_HANDLER_ARGS);
218
static int carp_dscp_sysctl(SYSCTL_HANDLER_ARGS);
224
static int carp_dscp_sysctl(SYSCTL_HANDLER_ARGS);
219
static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS);
225
static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS);
Lines 243-248 SYSCTL_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, Link Here
243
    CTLFLAG_VNET | CTLFLAG_RW,
249
    CTLFLAG_VNET | CTLFLAG_RW,
244
    &VNET_NAME(carp_ifdown_adj), 0,
250
    &VNET_NAME(carp_ifdown_adj), 0,
245
    "Interface down demotion factor adjustment");
251
    "Interface down demotion factor adjustment");
252
#ifdef INET
253
SYSCTL_BOOL(_net_inet_carp, OID_AUTO, use_carp_src_mac_in_arp,
254
    CTLFLAG_VNET | CTLFLAG_RW,
255
    &VNET_NAME(use_carp_src_mac_in_arp), false,
256
    "Use CARP MAC address as src address in ARP packet ethernet header.");
257
#endif
246
258
247
VNET_PCPUSTAT_DEFINE(struct carpstats, carpstats);
259
VNET_PCPUSTAT_DEFINE(struct carpstats, carpstats);
248
VNET_PCPUSTAT_SYSINIT(carpstats);
260
VNET_PCPUSTAT_SYSINIT(carpstats);

Return to bug 262828