Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: constify dev_addr passing

In preparation for netdev->dev_addr being constant
make all relevant arguments in ndisc constant.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+5 -5
+1 -1
include/net/ndisc.h
··· 137 137 u8 *opt, int opt_len, 138 138 struct ndisc_options *ndopts); 139 139 140 - void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, 140 + void __ndisc_fill_addr_option(struct sk_buff *skb, int type, const void *data, 141 141 int data_len, int pad); 142 142 143 143 #define NDISC_OPS_REDIRECT_DATA_SPACE 2
+2 -2
net/ipv6/addrconf.c
··· 2237 2237 2238 2238 static int addrconf_ifid_ieee1394(u8 *eui, struct net_device *dev) 2239 2239 { 2240 - union fwnet_hwaddr *ha; 2240 + const union fwnet_hwaddr *ha; 2241 2241 2242 2242 if (dev->addr_len != FWNET_ALEN) 2243 2243 return -1; 2244 2244 2245 - ha = (union fwnet_hwaddr *)dev->dev_addr; 2245 + ha = (const union fwnet_hwaddr *)dev->dev_addr; 2246 2246 2247 2247 memcpy(eui, &ha->uc.uniq_id, sizeof(ha->uc.uniq_id)); 2248 2248 eui[0] ^= 2;
+2 -2
net/ipv6/ndisc.c
··· 142 142 }; 143 143 EXPORT_SYMBOL_GPL(nd_tbl); 144 144 145 - void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data, 145 + void __ndisc_fill_addr_option(struct sk_buff *skb, int type, const void *data, 146 146 int data_len, int pad) 147 147 { 148 148 int space = __ndisc_opt_addr_space(data_len, pad); ··· 165 165 EXPORT_SYMBOL_GPL(__ndisc_fill_addr_option); 166 166 167 167 static inline void ndisc_fill_addr_option(struct sk_buff *skb, int type, 168 - void *data, u8 icmp6_type) 168 + const void *data, u8 icmp6_type) 169 169 { 170 170 __ndisc_fill_addr_option(skb, type, data, skb->dev->addr_len, 171 171 ndisc_addr_option_pad(skb->dev->type));