addrconf.h (a976c2951d8f376112361830aa7762beff83a205) | addrconf.h (1be9246077f6bb1583f9347c599480621d63c66a) |
---|---|
1#ifndef _ADDRCONF_H 2#define _ADDRCONF_H 3 4#define MAX_RTR_SOLICITATIONS -1 /* unlimited */ 5#define RTR_SOLICITATION_INTERVAL (4*HZ) 6#define RTR_SOLICITATION_MAX_INTERVAL (3600*HZ) /* 1 hour */ 7 8#define MIN_VALID_LIFETIME (2*3600) /* 2 hours */ --- 34 unchanged lines hidden (view full) --- 43#endif 44 __be32 valid; 45 __be32 prefered; 46 __be32 reserved2; 47 48 struct in6_addr prefix; 49}; 50 | 1#ifndef _ADDRCONF_H 2#define _ADDRCONF_H 3 4#define MAX_RTR_SOLICITATIONS -1 /* unlimited */ 5#define RTR_SOLICITATION_INTERVAL (4*HZ) 6#define RTR_SOLICITATION_MAX_INTERVAL (3600*HZ) /* 1 hour */ 7 8#define MIN_VALID_LIFETIME (2*3600) /* 2 hours */ --- 34 unchanged lines hidden (view full) --- 43#endif 44 __be32 valid; 45 __be32 prefered; 46 __be32 reserved2; 47 48 struct in6_addr prefix; 49}; 50 |
51 | |
52#include <linux/netdevice.h> 53#include <net/if_inet6.h> 54#include <net/ipv6.h> 55 | 51#include <linux/netdevice.h> 52#include <net/if_inet6.h> 53#include <net/ipv6.h> 54 |
55struct in6_validator_info { 56 struct in6_addr i6vi_addr; 57 struct inet6_dev *i6vi_dev; 58}; 59 |
|
56#define IN6_ADDR_HSIZE_SHIFT 4 57#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) 58 59int addrconf_init(void); 60void addrconf_cleanup(void); 61 62int addrconf_add_ifaddr(struct net *net, void __user *arg); 63int addrconf_del_ifaddr(struct net *net, void __user *arg); --- 209 unchanged lines hidden (view full) --- 273bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev, 274 const struct in6_addr *addr); 275 276/* Device notifier */ 277int register_inet6addr_notifier(struct notifier_block *nb); 278int unregister_inet6addr_notifier(struct notifier_block *nb); 279int inet6addr_notifier_call_chain(unsigned long val, void *v); 280 | 60#define IN6_ADDR_HSIZE_SHIFT 4 61#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) 62 63int addrconf_init(void); 64void addrconf_cleanup(void); 65 66int addrconf_add_ifaddr(struct net *net, void __user *arg); 67int addrconf_del_ifaddr(struct net *net, void __user *arg); --- 209 unchanged lines hidden (view full) --- 277bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev, 278 const struct in6_addr *addr); 279 280/* Device notifier */ 281int register_inet6addr_notifier(struct notifier_block *nb); 282int unregister_inet6addr_notifier(struct notifier_block *nb); 283int inet6addr_notifier_call_chain(unsigned long val, void *v); 284 |
285int register_inet6addr_validator_notifier(struct notifier_block *nb); 286int unregister_inet6addr_validator_notifier(struct notifier_block *nb); 287int inet6addr_validator_notifier_call_chain(unsigned long val, void *v); 288 |
|
281void inet6_netconf_notify_devconf(struct net *net, int event, int type, 282 int ifindex, struct ipv6_devconf *devconf); 283 284/** 285 * __in6_dev_get - get inet6_dev pointer from netdevice 286 * @dev: network device 287 * 288 * Caller must hold rcu_read_lock or RTNL, because this function --- 14 unchanged lines hidden (view full) --- 303 */ 304static inline struct inet6_dev *in6_dev_get(const struct net_device *dev) 305{ 306 struct inet6_dev *idev; 307 308 rcu_read_lock(); 309 idev = rcu_dereference(dev->ip6_ptr); 310 if (idev) | 289void inet6_netconf_notify_devconf(struct net *net, int event, int type, 290 int ifindex, struct ipv6_devconf *devconf); 291 292/** 293 * __in6_dev_get - get inet6_dev pointer from netdevice 294 * @dev: network device 295 * 296 * Caller must hold rcu_read_lock or RTNL, because this function --- 14 unchanged lines hidden (view full) --- 311 */ 312static inline struct inet6_dev *in6_dev_get(const struct net_device *dev) 313{ 314 struct inet6_dev *idev; 315 316 rcu_read_lock(); 317 idev = rcu_dereference(dev->ip6_ptr); 318 if (idev) |
311 atomic_inc(&idev->refcnt); | 319 refcount_inc(&idev->refcnt); |
312 rcu_read_unlock(); 313 return idev; 314} 315 316static inline struct neigh_parms *__in6_dev_nd_parms_get_rcu(const struct net_device *dev) 317{ 318 struct inet6_dev *idev = __in6_dev_get(dev); 319 320 return idev ? idev->nd_parms : NULL; 321} 322 323void in6_dev_finish_destroy(struct inet6_dev *idev); 324 325static inline void in6_dev_put(struct inet6_dev *idev) 326{ | 320 rcu_read_unlock(); 321 return idev; 322} 323 324static inline struct neigh_parms *__in6_dev_nd_parms_get_rcu(const struct net_device *dev) 325{ 326 struct inet6_dev *idev = __in6_dev_get(dev); 327 328 return idev ? idev->nd_parms : NULL; 329} 330 331void in6_dev_finish_destroy(struct inet6_dev *idev); 332 333static inline void in6_dev_put(struct inet6_dev *idev) 334{ |
327 if (atomic_dec_and_test(&idev->refcnt)) | 335 if (refcount_dec_and_test(&idev->refcnt)) |
328 in6_dev_finish_destroy(idev); 329} 330 331static inline void __in6_dev_put(struct inet6_dev *idev) 332{ | 336 in6_dev_finish_destroy(idev); 337} 338 339static inline void __in6_dev_put(struct inet6_dev *idev) 340{ |
333 atomic_dec(&idev->refcnt); | 341 refcount_dec(&idev->refcnt); |
334} 335 336static inline void in6_dev_hold(struct inet6_dev *idev) 337{ | 342} 343 344static inline void in6_dev_hold(struct inet6_dev *idev) 345{ |
338 atomic_inc(&idev->refcnt); | 346 refcount_inc(&idev->refcnt); |
339} 340 341void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 342 343static inline void in6_ifa_put(struct inet6_ifaddr *ifp) 344{ 345 if (atomic_dec_and_test(&ifp->refcnt)) 346 inet6_ifa_finish_destroy(ifp); --- 76 unchanged lines hidden --- | 347} 348 349void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 350 351static inline void in6_ifa_put(struct inet6_ifaddr *ifp) 352{ 353 if (atomic_dec_and_test(&ifp->refcnt)) 354 inet6_ifa_finish_destroy(ifp); --- 76 unchanged lines hidden --- |