extern void __VERIFIER_error() __attribute__ ((__noreturn__)); /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ struct kernel_symbol { unsigned long value ; char const *name ; }; struct module; typedef signed char __s8; typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef unsigned long long __u64; typedef signed char s8; typedef unsigned char u8; typedef short s16; typedef unsigned short u16; typedef int s32; typedef unsigned int u32; typedef long long s64; typedef unsigned long long u64; typedef long __kernel_long_t; typedef unsigned long __kernel_ulong_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef __kernel_ulong_t __kernel_size_t; typedef __kernel_long_t __kernel_ssize_t; typedef long long __kernel_loff_t; typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef __u16 __be16; typedef __u32 __be32; typedef __u32 __wsum; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef unsigned short umode_t; typedef __kernel_pid_t pid_t; typedef __kernel_clockid_t clockid_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __s16 int16_t; typedef __s32 int32_t; typedef __u8 uint8_t; typedef __u16 uint16_t; typedef __u32 uint32_t; typedef __u64 uint64_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef u64 dma_addr_t; typedef unsigned int gfp_t; typedef unsigned int fmode_t; typedef unsigned int oom_flags_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct callback_head { struct callback_head *next ; void (*func)(struct callback_head * ) ; }; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct __anonstruct_ldv_1022_9 { unsigned int a ; unsigned int b ; }; struct __anonstruct_ldv_1037_10 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion_ldv_1038_8 { struct __anonstruct_ldv_1022_9 ldv_1022 ; struct __anonstruct_ldv_1037_10 ldv_1037 ; }; struct desc_struct { union __anonunion_ldv_1038_8 ldv_1038 ; }; typedef unsigned long pteval_t; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct __anonstruct_pte_t_11 { pteval_t pte ; }; typedef struct __anonstruct_pte_t_11 pte_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_12 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_12 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct mm_struct; struct task_struct; struct cpumask; struct arch_spinlock; typedef u16 __ticket_t; typedef u32 __ticketpair_t; struct __raw_tickets { __ticket_t head ; __ticket_t tail ; }; union __anonunion_ldv_1458_15 { __ticketpair_t head_tail ; struct __raw_tickets tickets ; }; struct arch_spinlock { union __anonunion_ldv_1458_15 ldv_1458 ; }; typedef struct arch_spinlock arch_spinlock_t; struct qrwlock { atomic_t cnts ; arch_spinlock_t lock ; }; typedef struct qrwlock arch_rwlock_t; typedef void (*ctor_fn_t)(void); struct device; struct net_device; struct file_operations; struct completion; struct pid; struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct timespec; struct kernel_vm86_regs { struct pt_regs pt ; unsigned short es ; unsigned short __esh ; unsigned short ds ; unsigned short __dsh ; unsigned short fs ; unsigned short __fsh ; unsigned short gs ; unsigned short __gsh ; }; union __anonunion_ldv_2998_20 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion_ldv_2998_20 ldv_2998 ; }; struct cpumask { unsigned long bits[128U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct seq_operations; struct i387_fsave_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct_ldv_5289_25 { u64 rip ; u64 rdp ; }; struct __anonstruct_ldv_5295_26 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion_ldv_5296_24 { struct __anonstruct_ldv_5289_25 ldv_5289 ; struct __anonstruct_ldv_5295_26 ldv_5295 ; }; union __anonunion_ldv_5305_27 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion_ldv_5296_24 ldv_5296 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion_ldv_5305_27 ldv_5305 ; }; struct i387_soft_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct ymmh_struct { u32 ymmh_space[64U] ; }; struct lwp_struct { u8 reserved[128U] ; }; struct bndregs_struct { u64 bndregs[8U] ; }; struct bndcsr_struct { u64 cfg_reg_u ; u64 status_reg ; }; struct xsave_hdr_struct { u64 xstate_bv ; u64 reserved1[2U] ; u64 reserved2[5U] ; }; struct xsave_struct { struct i387_fxsave_struct i387 ; struct xsave_hdr_struct xsave_hdr ; struct ymmh_struct ymmh ; struct lwp_struct lwp ; struct bndregs_struct bndregs ; struct bndcsr_struct bndcsr ; }; union thread_xstate { struct i387_fsave_struct fsave ; struct i387_fxsave_struct fxsave ; struct i387_soft_struct soft ; struct xsave_struct xsave ; }; struct fpu { unsigned int last_cpu ; unsigned int has_fpu ; union thread_xstate *state ; }; struct kmem_cache; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned long usersp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; struct fpu fpu ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; unsigned char fpu_counter ; }; typedef atomic64_t atomic_long_t; typedef int pao_T__; typedef int pao_T_____0; struct lockdep_map; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; } __attribute__((__packed__)) ; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; struct held_lock { u64 prev_chain_key ; unsigned long acquire_ip ; struct lockdep_map *instance ; struct lockdep_map *nest_lock ; u64 waittime_stamp ; u64 holdtime_stamp ; unsigned short class_idx : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 1 ; unsigned char hardirqs_off : 1 ; unsigned short references : 12 ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct_ldv_6346_31 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion_ldv_6347_30 { struct raw_spinlock rlock ; struct __anonstruct_ldv_6346_31 ldv_6346 ; }; struct spinlock { union __anonunion_ldv_6347_30 ldv_6347 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_32 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_32 rwlock_t; struct seqcount { unsigned int sequence ; struct lockdep_map dep_map ; }; typedef struct seqcount seqcount_t; struct __anonstruct_seqlock_t_33 { struct seqcount seqcount ; spinlock_t lock ; }; typedef struct __anonstruct_seqlock_t_33 seqlock_t; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; struct __anonstruct_kuid_t_34 { uid_t val ; }; typedef struct __anonstruct_kuid_t_34 kuid_t; struct __anonstruct_kgid_t_35 { gid_t val ; }; typedef struct __anonstruct_kgid_t_35 kgid_t; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; kuid_t uid ; kgid_t gid ; dev_t rdev ; loff_t size ; struct timespec atime ; struct timespec mtime ; struct timespec ctime ; unsigned long blksize ; unsigned long long blocks ; }; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct __anonstruct_nodemask_t_36 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_36 nodemask_t; struct optimistic_spin_queue; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; char const *name ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct rw_semaphore; struct rw_semaphore { long count ; raw_spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; struct optimistic_spin_queue *osq ; struct lockdep_map dep_map ; }; struct completion { unsigned int done ; wait_queue_head_t wait ; }; struct llist_node; struct llist_node { struct llist_node *next ; }; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct tvec_base; struct timer_list { struct list_head entry ; unsigned long expires ; struct tvec_base *base ; void (*function)(unsigned long ) ; unsigned long data ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct workqueue_struct; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; struct workqueue_struct *wq ; int cpu ; }; struct pm_message { int event ; }; typedef struct pm_message pm_message_t; struct dev_pm_ops { int (*prepare)(struct device * ) ; void (*complete)(struct device * ) ; int (*suspend)(struct device * ) ; int (*resume)(struct device * ) ; int (*freeze)(struct device * ) ; int (*thaw)(struct device * ) ; int (*poweroff)(struct device * ) ; int (*restore)(struct device * ) ; int (*suspend_late)(struct device * ) ; int (*resume_early)(struct device * ) ; int (*freeze_late)(struct device * ) ; int (*thaw_early)(struct device * ) ; int (*poweroff_late)(struct device * ) ; int (*restore_early)(struct device * ) ; int (*suspend_noirq)(struct device * ) ; int (*resume_noirq)(struct device * ) ; int (*freeze_noirq)(struct device * ) ; int (*thaw_noirq)(struct device * ) ; int (*poweroff_noirq)(struct device * ) ; int (*restore_noirq)(struct device * ) ; int (*runtime_suspend)(struct device * ) ; int (*runtime_resume)(struct device * ) ; int (*runtime_idle)(struct device * ) ; }; enum rpm_status { RPM_ACTIVE = 0, RPM_RESUMING = 1, RPM_SUSPENDED = 2, RPM_SUSPENDING = 3 } ; enum rpm_request { RPM_REQ_NONE = 0, RPM_REQ_IDLE = 1, RPM_REQ_SUSPEND = 2, RPM_REQ_AUTOSUSPEND = 3, RPM_REQ_RESUME = 4 } ; struct wakeup_source; struct pm_subsys_data { spinlock_t lock ; unsigned int refcount ; struct list_head clock_list ; }; struct dev_pm_qos; struct dev_pm_info { pm_message_t power_state ; unsigned char can_wakeup : 1 ; unsigned char async_suspend : 1 ; bool is_prepared ; bool is_suspended ; bool is_noirq_suspended ; bool is_late_suspended ; bool ignore_children ; bool early_init ; bool direct_complete ; spinlock_t lock ; struct list_head entry ; struct completion completion ; struct wakeup_source *wakeup ; bool wakeup_path ; bool syscore ; struct timer_list suspend_timer ; unsigned long timer_expires ; struct work_struct work ; wait_queue_head_t wait_queue ; atomic_t usage_count ; atomic_t child_count ; unsigned char disable_depth : 3 ; unsigned char idle_notification : 1 ; unsigned char request_pending : 1 ; unsigned char deferred_resume : 1 ; unsigned char run_wake : 1 ; unsigned char runtime_auto : 1 ; unsigned char no_callbacks : 1 ; unsigned char irq_safe : 1 ; unsigned char use_autosuspend : 1 ; unsigned char timer_autosuspends : 1 ; unsigned char memalloc_noio : 1 ; enum rpm_request request ; enum rpm_status runtime_status ; int runtime_error ; int autosuspend_delay ; unsigned long last_busy ; unsigned long active_jiffies ; unsigned long suspended_jiffies ; unsigned long accounting_timestamp ; struct pm_subsys_data *subsys_data ; void (*set_latency_tolerance)(struct device * , s32 ) ; struct dev_pm_qos *qos ; }; struct dev_pm_domain { struct dev_pm_ops ops ; }; struct __anonstruct_mm_context_t_101 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_101 mm_context_t; struct rb_node { unsigned long __rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; } __attribute__((__aligned__(sizeof(long )))) ; struct rb_root { struct rb_node *rb_node ; }; struct vm_area_struct; struct bio_vec; struct notifier_block; struct notifier_block { int (*notifier_call)(struct notifier_block * , unsigned long , void * ) ; struct notifier_block *next ; int priority ; }; struct blocking_notifier_head { struct rw_semaphore rwsem ; struct notifier_block *head ; }; struct ctl_table; struct nsproxy; struct ctl_table_root; struct ctl_table_header; struct ctl_dir; typedef int proc_handler(struct ctl_table * , int , void * , size_t * , loff_t * ); struct ctl_table_poll { atomic_t event ; wait_queue_head_t wait ; }; struct ctl_table { char const *procname ; void *data ; int maxlen ; umode_t mode ; struct ctl_table *child ; proc_handler *proc_handler ; struct ctl_table_poll *poll ; void *extra1 ; void *extra2 ; }; struct ctl_node { struct rb_node node ; struct ctl_table_header *header ; }; struct __anonstruct_ldv_13760_129 { struct ctl_table *ctl_table ; int used ; int count ; int nreg ; }; union __anonunion_ldv_13762_128 { struct __anonstruct_ldv_13760_129 ldv_13760 ; struct callback_head rcu ; }; struct ctl_table_set; struct ctl_table_header { union __anonunion_ldv_13762_128 ldv_13762 ; struct completion *unregistering ; struct ctl_table *ctl_table_arg ; struct ctl_table_root *root ; struct ctl_table_set *set ; struct ctl_dir *parent ; struct ctl_node *node ; }; struct ctl_dir { struct ctl_table_header header ; struct rb_root root ; }; struct ctl_table_set { int (*is_seen)(struct ctl_table_set * ) ; struct ctl_dir dir ; }; struct ctl_table_root { struct ctl_table_set default_set ; struct ctl_table_set *(*lookup)(struct ctl_table_root * , struct nsproxy * ) ; int (*permissions)(struct ctl_table_header * , struct ctl_table * ) ; }; struct cred; struct inode; struct arch_uprobe_task { unsigned long saved_scratch_register ; unsigned int saved_trap_nr ; unsigned int saved_tf ; }; enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ; struct __anonstruct_ldv_14006_136 { struct arch_uprobe_task autask ; unsigned long vaddr ; }; struct __anonstruct_ldv_14010_137 { struct callback_head dup_xol_work ; unsigned long dup_xol_addr ; }; union __anonunion_ldv_14011_135 { struct __anonstruct_ldv_14006_136 ldv_14006 ; struct __anonstruct_ldv_14010_137 ldv_14010 ; }; struct uprobe; struct return_instance; struct uprobe_task { enum uprobe_task_state state ; union __anonunion_ldv_14011_135 ldv_14011 ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; struct return_instance *return_instances ; unsigned int depth ; }; struct xol_area; struct uprobes_state { struct xol_area *xol_area ; }; struct address_space; union __anonunion_ldv_14120_138 { struct address_space *mapping ; void *s_mem ; }; union __anonunion_ldv_14126_140 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct_ldv_14136_144 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion_ldv_14138_143 { atomic_t _mapcount ; struct __anonstruct_ldv_14136_144 ldv_14136 ; int units ; }; struct __anonstruct_ldv_14140_142 { union __anonunion_ldv_14138_143 ldv_14138 ; atomic_t _count ; }; union __anonunion_ldv_14142_141 { unsigned long counters ; struct __anonstruct_ldv_14140_142 ldv_14140 ; unsigned int active ; }; struct __anonstruct_ldv_14143_139 { union __anonunion_ldv_14126_140 ldv_14126 ; union __anonunion_ldv_14142_141 ldv_14142 ; }; struct __anonstruct_ldv_14150_146 { struct page *next ; int pages ; int pobjects ; }; struct slab; union __anonunion_ldv_14155_145 { struct list_head lru ; struct __anonstruct_ldv_14150_146 ldv_14150 ; struct slab *slab_page ; struct callback_head callback_head ; pgtable_t pmd_huge_pte ; }; union __anonunion_ldv_14161_147 { unsigned long private ; spinlock_t *ptl ; struct kmem_cache *slab_cache ; struct page *first_page ; }; struct page { unsigned long flags ; union __anonunion_ldv_14120_138 ldv_14120 ; struct __anonstruct_ldv_14143_139 ldv_14143 ; union __anonunion_ldv_14155_145 ldv_14155 ; union __anonunion_ldv_14161_147 ldv_14161 ; unsigned long debug_flags ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_linear_149 { struct rb_node rb ; unsigned long rb_subtree_last ; }; union __anonunion_shared_148 { struct __anonstruct_linear_149 linear ; struct list_head nonlinear ; }; struct anon_vma; struct vm_operations_struct; struct mempolicy; struct vm_area_struct { unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; struct rb_node vm_rb ; unsigned long rb_subtree_gap ; struct mm_struct *vm_mm ; pgprot_t vm_page_prot ; unsigned long vm_flags ; union __anonunion_shared_148 shared ; struct list_head anon_vma_chain ; struct anon_vma *anon_vma ; struct vm_operations_struct const *vm_ops ; unsigned long vm_pgoff ; struct file *vm_file ; void *vm_private_data ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct task_rss_stat { int events ; int count[3U] ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct kioctx_table; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; u32 vmacache_seqnum ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; unsigned long mmap_base ; unsigned long mmap_legacy_base ; unsigned long task_size ; unsigned long highest_vm_end ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; atomic_long_t nr_ptes ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long pinned_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long def_flags ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[46U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct kioctx_table *ioctx_table ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; struct cpumask cpumask_allocation ; unsigned long numa_next_scan ; unsigned long numa_scan_offset ; int numa_scan_seq ; bool tlb_flush_pending ; struct uprobes_state uprobes_state ; }; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; union __anonunion_ldv_14524_153 { unsigned long bitmap[4U] ; struct callback_head callback_head ; }; struct idr_layer { int prefix ; int layer ; struct idr_layer *ary[256U] ; int count ; union __anonunion_ldv_14524_153 ldv_14524 ; }; struct idr { struct idr_layer *hint ; struct idr_layer *top ; int layers ; int cur ; spinlock_t lock ; int id_free_cnt ; struct idr_layer *id_free ; }; struct ida_bitmap { long nr_busy ; unsigned long bitmap[15U] ; }; struct ida { struct idr idr ; struct ida_bitmap *free_bitmap ; }; struct dentry; struct iattr; struct super_block; struct file_system_type; struct kernfs_open_node; struct kernfs_iattrs; struct kernfs_root; struct kernfs_elem_dir { unsigned long subdirs ; struct rb_root children ; struct kernfs_root *root ; }; struct kernfs_node; struct kernfs_elem_symlink { struct kernfs_node *target_kn ; }; struct kernfs_ops; struct kernfs_elem_attr { struct kernfs_ops const *ops ; struct kernfs_open_node *open ; loff_t size ; }; union __anonunion_ldv_14668_154 { struct kernfs_elem_dir dir ; struct kernfs_elem_symlink symlink ; struct kernfs_elem_attr attr ; }; struct kernfs_node { atomic_t count ; atomic_t active ; struct lockdep_map dep_map ; struct kernfs_node *parent ; char const *name ; struct rb_node rb ; void const *ns ; unsigned int hash ; union __anonunion_ldv_14668_154 ldv_14668 ; void *priv ; unsigned short flags ; umode_t mode ; unsigned int ino ; struct kernfs_iattrs *iattr ; }; struct kernfs_syscall_ops { int (*remount_fs)(struct kernfs_root * , int * , char * ) ; int (*show_options)(struct seq_file * , struct kernfs_root * ) ; int (*mkdir)(struct kernfs_node * , char const * , umode_t ) ; int (*rmdir)(struct kernfs_node * ) ; int (*rename)(struct kernfs_node * , struct kernfs_node * , char const * ) ; }; struct kernfs_root { struct kernfs_node *kn ; unsigned int flags ; struct ida ino_ida ; struct kernfs_syscall_ops *syscall_ops ; struct list_head supers ; wait_queue_head_t deactivate_waitq ; }; struct kernfs_open_file { struct kernfs_node *kn ; struct file *file ; void *priv ; struct mutex mutex ; int event ; struct list_head list ; size_t atomic_write_len ; bool mmapped ; struct vm_operations_struct const *vm_ops ; }; struct kernfs_ops { int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; ssize_t (*read)(struct kernfs_open_file * , char * , size_t , loff_t ) ; size_t atomic_write_len ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; int (*mmap)(struct kernfs_open_file * , struct vm_area_struct * ) ; struct lock_class_key lockdep_key ; }; struct sock; struct kobject; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; bool (*current_may_mount)(void) ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct bin_attribute; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct attribute_group { char const *name ; umode_t (*is_visible)(struct kobject * , struct attribute * , int ) ; struct attribute **attrs ; struct bin_attribute **bin_attrs ; }; struct bin_attribute { struct attribute attr ; size_t size ; void *private ; ssize_t (*read)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; ssize_t (*write)(struct file * , struct kobject * , struct bin_attribute * , char * , loff_t , size_t ) ; int (*mmap)(struct file * , struct kobject * , struct bin_attribute * , struct vm_area_struct * ) ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; }; struct kref { atomic_t refcount ; }; struct kset; struct kobj_type; struct kobject { char const *name ; struct list_head entry ; struct kobject *parent ; struct kset *kset ; struct kobj_type *ktype ; struct kernfs_node *sd ; struct kref kref ; struct delayed_work release ; unsigned char state_initialized : 1 ; unsigned char state_in_sysfs : 1 ; unsigned char state_add_uevent_sent : 1 ; unsigned char state_remove_uevent_sent : 1 ; unsigned char uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *argv[3U] ; char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct kernel_param; struct kernel_param_ops { unsigned int flags ; int (*set)(char const * , struct kernel_param const * ) ; int (*get)(char * , struct kernel_param const * ) ; void (*free)(void * ) ; }; struct kparam_string; struct kparam_array; union __anonunion_ldv_15343_155 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct kernel_param_ops const *ops ; u16 perm ; s16 level ; union __anonunion_ldv_15343_155 ldv_15343 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct mod_arch_specific { }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; struct completion *kobj_completion ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module_kobject * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module_kobject * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ; struct module_ref { unsigned long incs ; unsigned long decs ; }; struct module_sect_attrs; struct module_notes_attrs; struct tracepoint; struct ftrace_event_call; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; bool sig_ok ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct ftrace_event_call **trace_events ; unsigned int num_trace_events ; unsigned int num_ftrace_callsites ; unsigned long *ftrace_callsites ; struct list_head source_list ; struct list_head target_list ; void (*exit)(void) ; struct module_ref *refptr ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct mem_cgroup; struct kmem_cache_cpu { void **freelist ; unsigned long tid ; struct page *page ; struct page *partial ; unsigned int stat[26U] ; }; struct kmem_cache_order_objects { unsigned long x ; }; struct memcg_cache_params; struct kmem_cache_node; struct kmem_cache { struct kmem_cache_cpu *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int object_size ; int offset ; int cpu_partial ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject kobj ; struct memcg_cache_params *memcg_params ; int max_attr_size ; struct kset *memcg_kset ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1024U] ; }; struct __anonstruct_ldv_15969_157 { struct callback_head callback_head ; struct kmem_cache *memcg_caches[0U] ; }; struct __anonstruct_ldv_15975_158 { struct mem_cgroup *memcg ; struct list_head list ; struct kmem_cache *root_cache ; atomic_t nr_pages ; }; union __anonunion_ldv_15976_156 { struct __anonstruct_ldv_15969_157 ldv_15969 ; struct __anonstruct_ldv_15975_158 ldv_15975 ; }; struct memcg_cache_params { bool is_root_cache ; union __anonunion_ldv_15976_156 ldv_15976 ; }; struct batadv_neigh_node; struct batadv_hard_iface; struct batadv_orig_node; struct plist_head { struct list_head node_list ; }; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; struct klist_node; struct klist_node { void *n_klist ; struct list_head n_node ; struct kref n_ref ; }; struct path; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; size_t pad_until ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; struct user_namespace *user_ns ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct pinctrl; struct pinctrl_state; struct dev_pin_info { struct pinctrl *p ; struct pinctrl_state *default_state ; struct pinctrl_state *sleep_state ; struct pinctrl_state *idle_state ; }; struct dma_map_ops; struct dev_archdata { struct dma_map_ops *dma_ops ; void *iommu ; }; struct device_private; struct device_driver; struct driver_private; struct class; struct subsys_private; struct bus_type; struct device_node; struct iommu_ops; struct iommu_group; struct device_attribute; struct bus_type { char const *name ; char const *dev_name ; struct device *dev_root ; struct device_attribute *dev_attrs ; struct attribute_group const **bus_groups ; struct attribute_group const **dev_groups ; struct attribute_group const **drv_groups ; int (*match)(struct device * , struct device_driver * ) ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*online)(struct device * ) ; int (*offline)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct dev_pm_ops const *pm ; struct iommu_ops *iommu_ops ; struct subsys_private *p ; struct lock_class_key lock_key ; }; struct device_type; struct of_device_id; struct acpi_device_id; struct device_driver { char const *name ; struct bus_type *bus ; struct module *owner ; char const *mod_name ; bool suppress_bind_attrs ; struct of_device_id const *of_match_table ; struct acpi_device_id const *acpi_match_table ; int (*probe)(struct device * ) ; int (*remove)(struct device * ) ; void (*shutdown)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct attribute_group const **groups ; struct dev_pm_ops const *pm ; struct driver_private *p ; }; struct class_attribute; struct class { char const *name ; struct module *owner ; struct class_attribute *class_attrs ; struct attribute_group const **dev_groups ; struct kobject *dev_kobj ; int (*dev_uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * ) ; void (*class_release)(struct class * ) ; void (*dev_release)(struct device * ) ; int (*suspend)(struct device * , pm_message_t ) ; int (*resume)(struct device * ) ; struct kobj_ns_type_operations const *ns_type ; void const *(*namespace)(struct device * ) ; struct dev_pm_ops const *pm ; struct subsys_private *p ; }; struct class_attribute { struct attribute attr ; ssize_t (*show)(struct class * , struct class_attribute * , char * ) ; ssize_t (*store)(struct class * , struct class_attribute * , char const * , size_t ) ; }; struct device_type { char const *name ; struct attribute_group const **groups ; int (*uevent)(struct device * , struct kobj_uevent_env * ) ; char *(*devnode)(struct device * , umode_t * , kuid_t * , kgid_t * ) ; void (*release)(struct device * ) ; struct dev_pm_ops const *pm ; }; struct device_attribute { struct attribute attr ; ssize_t (*show)(struct device * , struct device_attribute * , char * ) ; ssize_t (*store)(struct device * , struct device_attribute * , char const * , size_t ) ; }; struct device_dma_parameters { unsigned int max_segment_size ; unsigned long segment_boundary_mask ; }; struct acpi_device; struct acpi_dev_node { struct acpi_device *companion ; }; struct dma_coherent_mem; struct cma; struct device { struct device *parent ; struct device_private *p ; struct kobject kobj ; char const *init_name ; struct device_type const *type ; struct mutex mutex ; struct bus_type *bus ; struct device_driver *driver ; void *platform_data ; void *driver_data ; struct dev_pm_info power ; struct dev_pm_domain *pm_domain ; struct dev_pin_info *pins ; int numa_node ; u64 *dma_mask ; u64 coherent_dma_mask ; unsigned long dma_pfn_offset ; struct device_dma_parameters *dma_parms ; struct list_head dma_pools ; struct dma_coherent_mem *dma_mem ; struct cma *cma_area ; struct dev_archdata archdata ; struct device_node *of_node ; struct acpi_dev_node acpi_node ; dev_t devt ; u32 id ; spinlock_t devres_lock ; struct list_head devres_head ; struct klist_node knode_class ; struct class *class ; struct attribute_group const **groups ; void (*release)(struct device * ) ; struct iommu_group *iommu_group ; bool offline_disabled ; bool offline ; }; struct wakeup_source { char const *name ; struct list_head entry ; spinlock_t lock ; struct timer_list timer ; unsigned long timer_expires ; ktime_t total_time ; ktime_t max_time ; ktime_t last_time ; ktime_t start_prevent_time ; ktime_t prevent_sleep_time ; unsigned long event_count ; unsigned long active_count ; unsigned long relax_count ; unsigned long expire_count ; unsigned long wakeup_count ; bool active ; bool autosleep_enabled ; }; struct pm_qos_request { struct plist_node node ; int pm_qos_class ; struct delayed_work work ; }; struct pm_qos_flags_request { struct list_head node ; s32 flags ; }; enum dev_pm_qos_req_type { DEV_PM_QOS_RESUME_LATENCY = 1, DEV_PM_QOS_LATENCY_TOLERANCE = 2, DEV_PM_QOS_FLAGS = 3 } ; union __anonunion_data_159 { struct plist_node pnode ; struct pm_qos_flags_request flr ; }; struct dev_pm_qos_request { enum dev_pm_qos_req_type type ; union __anonunion_data_159 data ; struct device *dev ; }; enum pm_qos_type { PM_QOS_UNITIALIZED = 0, PM_QOS_MAX = 1, PM_QOS_MIN = 2 } ; struct pm_qos_constraints { struct plist_head list ; s32 target_value ; s32 default_value ; s32 no_constraint_value ; enum pm_qos_type type ; struct blocking_notifier_head *notifiers ; }; struct pm_qos_flags { struct list_head list ; s32 effective_flags ; }; struct dev_pm_qos { struct pm_qos_constraints resume_latency ; struct pm_qos_constraints latency_tolerance ; struct pm_qos_flags flags ; struct dev_pm_qos_request *resume_latency_req ; struct dev_pm_qos_request *latency_tolerance_req ; struct dev_pm_qos_request *flags_req ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; union __anonunion_ldv_17837_160 { struct iovec const *iov ; struct bio_vec const *bvec ; }; struct iov_iter { int type ; size_t iov_offset ; size_t count ; union __anonunion_ldv_17837_160 ldv_17837 ; unsigned long nr_segs ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; nodemask_t nodes_to_scan ; int nid ; }; struct shrinker { unsigned long (*count_objects)(struct shrinker * , struct shrink_control * ) ; unsigned long (*scan_objects)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; unsigned long flags ; struct list_head list ; atomic_long_t *nr_deferred ; }; struct file_ra_state; struct user_struct; struct writeback_control; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *page ; unsigned long max_pgoff ; pte_t *pte ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; void (*map_pages)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; char const *(*name)(struct vm_area_struct * ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; int (*migrate)(struct vm_area_struct * , nodemask_t const * , nodemask_t const * , unsigned long ) ; int (*remap_pages)(struct vm_area_struct * , unsigned long , unsigned long , unsigned long ) ; }; struct scatterlist { unsigned long sg_magic ; unsigned long page_link ; unsigned int offset ; unsigned int length ; dma_addr_t dma_address ; unsigned int dma_length ; }; struct sg_table { struct scatterlist *sgl ; unsigned int nents ; unsigned int orig_nents ; }; typedef s32 dma_cookie_t; struct dql { unsigned int num_queued ; unsigned int adj_limit ; unsigned int last_obj_cnt ; unsigned int limit ; unsigned int num_completed ; unsigned int prev_ovlimit ; unsigned int prev_num_queued ; unsigned int prev_last_obj_cnt ; unsigned int lowest_slack ; unsigned long slack_start_time ; unsigned int max_limit ; unsigned int min_limit ; unsigned int slack_hold_time ; }; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; typedef unsigned short __kernel_sa_family_t; typedef __kernel_sa_family_t sa_family_t; struct sockaddr { sa_family_t sa_family ; char sa_data[14U] ; }; struct msghdr { void *msg_name ; int msg_namelen ; struct iovec *msg_iov ; __kernel_size_t msg_iovlen ; void *msg_control ; __kernel_size_t msg_controllen ; unsigned int msg_flags ; }; struct __anonstruct_sync_serial_settings_162 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; }; typedef struct __anonstruct_sync_serial_settings_162 sync_serial_settings; struct __anonstruct_te1_settings_163 { unsigned int clock_rate ; unsigned int clock_type ; unsigned short loopback ; unsigned int slot_map ; }; typedef struct __anonstruct_te1_settings_163 te1_settings; struct __anonstruct_raw_hdlc_proto_164 { unsigned short encoding ; unsigned short parity ; }; typedef struct __anonstruct_raw_hdlc_proto_164 raw_hdlc_proto; struct __anonstruct_fr_proto_165 { unsigned int t391 ; unsigned int t392 ; unsigned int n391 ; unsigned int n392 ; unsigned int n393 ; unsigned short lmi ; unsigned short dce ; }; typedef struct __anonstruct_fr_proto_165 fr_proto; struct __anonstruct_fr_proto_pvc_166 { unsigned int dlci ; }; typedef struct __anonstruct_fr_proto_pvc_166 fr_proto_pvc; struct __anonstruct_fr_proto_pvc_info_167 { unsigned int dlci ; char master[16U] ; }; typedef struct __anonstruct_fr_proto_pvc_info_167 fr_proto_pvc_info; struct __anonstruct_cisco_proto_168 { unsigned int interval ; unsigned int timeout ; }; typedef struct __anonstruct_cisco_proto_168 cisco_proto; struct ifmap { unsigned long mem_start ; unsigned long mem_end ; unsigned short base_addr ; unsigned char irq ; unsigned char dma ; unsigned char port ; }; union __anonunion_ifs_ifsu_169 { raw_hdlc_proto *raw_hdlc ; cisco_proto *cisco ; fr_proto *fr ; fr_proto_pvc *fr_pvc ; fr_proto_pvc_info *fr_pvc_info ; sync_serial_settings *sync ; te1_settings *te1 ; }; struct if_settings { unsigned int type ; unsigned int size ; union __anonunion_ifs_ifsu_169 ifs_ifsu ; }; union __anonunion_ifr_ifrn_170 { char ifrn_name[16U] ; }; union __anonunion_ifr_ifru_171 { struct sockaddr ifru_addr ; struct sockaddr ifru_dstaddr ; struct sockaddr ifru_broadaddr ; struct sockaddr ifru_netmask ; struct sockaddr ifru_hwaddr ; short ifru_flags ; int ifru_ivalue ; int ifru_mtu ; struct ifmap ifru_map ; char ifru_slave[16U] ; char ifru_newname[16U] ; void *ifru_data ; struct if_settings ifru_settings ; }; struct ifreq { union __anonunion_ifr_ifrn_170 ifr_ifrn ; union __anonunion_ifr_ifru_171 ifr_ifru ; }; struct hlist_bl_node; struct hlist_bl_head { struct hlist_bl_node *first ; }; struct hlist_bl_node { struct hlist_bl_node *next ; struct hlist_bl_node **pprev ; }; struct __anonstruct_ldv_21916_174 { spinlock_t lock ; unsigned int count ; }; union __anonunion_ldv_21917_173 { struct __anonstruct_ldv_21916_174 ldv_21916 ; }; struct lockref { union __anonunion_ldv_21917_173 ldv_21917 ; }; struct nameidata; struct vfsmount; struct __anonstruct_ldv_21940_176 { u32 hash ; u32 len ; }; union __anonunion_ldv_21942_175 { struct __anonstruct_ldv_21940_176 ldv_21940 ; u64 hash_len ; }; struct qstr { union __anonunion_ldv_21942_175 ldv_21942 ; unsigned char const *name ; }; struct dentry_operations; union __anonunion_d_u_177 { struct list_head d_child ; struct callback_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; struct lockref d_lockref ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; union __anonunion_d_u_177 d_u ; struct list_head d_subdirs ; struct hlist_node d_alias ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_weak_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct dentry const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_prune)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct list_lru_node { spinlock_t lock ; struct list_head list ; long nr_items ; }; struct list_lru { struct list_lru_node *node ; nodemask_t active_nodes ; }; struct __anonstruct_ldv_22303_179 { struct radix_tree_node *parent ; void *private_data ; }; union __anonunion_ldv_22305_178 { struct __anonstruct_ldv_22303_179 ldv_22303 ; struct callback_head callback_head ; }; struct radix_tree_node { unsigned int path ; unsigned int count ; union __anonunion_ldv_22305_178 ldv_22305 ; struct list_head private_list ; void *slots[64U] ; unsigned long tags[3U][1U] ; }; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct block_device; struct io_context; struct cgroup_subsys_state; struct bio_vec { struct page *bv_page ; unsigned int bv_len ; unsigned int bv_offset ; }; struct export_operations; struct kiocb; struct pipe_inode_info; struct poll_table_struct; struct kstatfs; struct swap_info_struct; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; kuid_t ia_uid ; kgid_t ia_gid ; loff_t ia_size ; struct timespec ia_atime ; struct timespec ia_mtime ; struct timespec ia_ctime ; struct file *ia_file ; }; struct percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct fs_disk_quota { __s8 d_version ; __s8 d_flags ; __u16 d_fieldmask ; __u32 d_id ; __u64 d_blk_hardlimit ; __u64 d_blk_softlimit ; __u64 d_ino_hardlimit ; __u64 d_ino_softlimit ; __u64 d_bcount ; __u64 d_icount ; __s32 d_itimer ; __s32 d_btimer ; __u16 d_iwarns ; __u16 d_bwarns ; __s32 d_padding2 ; __u64 d_rtb_hardlimit ; __u64 d_rtb_softlimit ; __u64 d_rtbcount ; __s32 d_rtbtimer ; __u16 d_rtbwarns ; __s16 d_padding3 ; char d_padding4[8U] ; }; struct fs_qfilestat { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; }; typedef struct fs_qfilestat fs_qfilestat_t; struct fs_quota_stat { __s8 qs_version ; __u16 qs_flags ; __s8 qs_pad ; fs_qfilestat_t qs_uquota ; fs_qfilestat_t qs_gquota ; __u32 qs_incoredqs ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; }; struct fs_qfilestatv { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; __u32 qfs_pad ; }; struct fs_quota_statv { __s8 qs_version ; __u8 qs_pad1 ; __u16 qs_flags ; __u32 qs_incoredqs ; struct fs_qfilestatv qs_uquota ; struct fs_qfilestatv qs_gquota ; struct fs_qfilestatv qs_pquota ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; __u64 qs_pad2[8U] ; }; struct dquot; typedef __kernel_uid32_t projid_t; struct __anonstruct_kprojid_t_181 { projid_t val ; }; typedef struct __anonstruct_kprojid_t_181 kprojid_t; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion_ldv_23102_182 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion_ldv_23102_182 ldv_23102 ; enum quota_type type ; }; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_maxblimit ; qsize_t dqi_maxilimit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; struct kqid dq_id ; loff_t dq_off ; unsigned long dq_flags ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_on_meta)(struct super_block * , int , int ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*get_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*set_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*set_xstate)(struct super_block * , unsigned int , int ) ; int (*get_xstatev)(struct super_block * , struct fs_quota_statv * ) ; int (*rm_xquota)(struct super_block * , unsigned int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct rw_semaphore dqptr_sem ; struct inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned int , unsigned int ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iov_iter * , loff_t ) ; int (*get_xip_mem)(struct address_space * , unsigned long , int , void ** , unsigned long * ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , unsigned long , unsigned long ) ; void (*is_dirty_writeback)(struct page * , bool * , bool * ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; int (*swap_activate)(struct swap_info_struct * , struct file * , sector_t * ) ; void (*swap_deactivate)(struct file * ) ; }; struct backing_dev_info; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; unsigned int i_mmap_writable ; struct rb_root i_mmap ; struct list_head i_mmap_nonlinear ; struct mutex i_mmap_mutex ; unsigned long nrpages ; unsigned long nrshadows ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; struct backing_dev_info *backing_dev_info ; spinlock_t private_lock ; struct list_head private_list ; void *private_data ; }; struct request_queue; struct hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; int bd_openers ; struct inode *bd_inode ; struct super_block *bd_super ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; bool bd_write_holder ; struct list_head bd_holder_disks ; struct block_device *bd_contains ; unsigned int bd_block_size ; struct hd_struct *bd_part ; unsigned int bd_part_count ; int bd_invalidated ; struct gendisk *bd_disk ; struct request_queue *bd_queue ; struct list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; union __anonunion_ldv_23517_185 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion_ldv_23537_186 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock; struct cdev; union __anonunion_ldv_23554_187 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { umode_t i_mode ; unsigned short i_opflags ; kuid_t i_uid ; kgid_t i_gid ; unsigned int i_flags ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion_ldv_23517_185 ldv_23517 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion_ldv_23537_186 ldv_23537 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; atomic_t i_readcount ; struct file_operations const *i_fop ; struct file_lock *i_flock ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion_ldv_23554_187 ldv_23554 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_t euid ; int signum ; }; struct file_ra_state { unsigned long start ; unsigned int size ; unsigned int async_size ; unsigned int ra_pages ; unsigned int mmap_miss ; loff_t prev_pos ; }; union __anonunion_f_u_188 { struct llist_node fu_llist ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_188 f_u ; struct path f_path ; struct inode *f_inode ; struct file_operations const *f_op ; spinlock_t f_lock ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; struct mutex f_pos_lock ; loff_t f_pos ; struct fown_struct f_owner ; struct cred const *f_cred ; struct file_ra_state f_ra ; u64 f_version ; void *f_security ; void *private_data ; struct list_head f_ep_links ; struct list_head f_tfile_llink ; struct address_space *f_mapping ; }; struct files_struct; typedef struct files_struct *fl_owner_t; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; unsigned long (*lm_owner_key)(struct file_lock * ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , struct file_lock * , int ) ; void (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock ** , int ) ; }; struct net; struct nlm_lockowner; struct nfs_lock_info { u32 state ; struct nlm_lockowner *owner ; struct list_head list ; }; struct nfs4_lock_state; struct nfs4_lock_info { struct nfs4_lock_state *owner ; }; struct fasync_struct; struct __anonstruct_afs_190 { struct list_head link ; int state ; }; union __anonunion_fl_u_189 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_190 afs ; }; struct file_lock { struct file_lock *fl_next ; struct hlist_node fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; int fl_link_cpu ; struct pid *fl_nspid ; wait_queue_head_t fl_wait ; struct file *fl_file ; loff_t fl_start ; loff_t fl_end ; struct fasync_struct *fl_fasync ; unsigned long fl_break_time ; unsigned long fl_downgrade_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_189 fl_u ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct callback_head fa_rcu ; }; struct sb_writers { struct percpu_counter counter[3U] ; wait_queue_head_t wait ; int frozen ; wait_queue_head_t wait_unfrozen ; struct lockdep_map lock_map[3U] ; }; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head s_mounts ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; struct workqueue_struct *s_dio_done_wq ; struct list_lru s_dentry_lru ; struct list_lru s_inode_lru ; struct callback_head rcu ; }; struct fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; struct dir_context { int (*actor)(void * , char const * , int , loff_t , u64 , unsigned int ) ; loff_t pos ; }; struct file_operations { struct module *owner ; loff_t (*llseek)(struct file * , loff_t , int ) ; ssize_t (*read)(struct file * , char * , size_t , loff_t * ) ; ssize_t (*write)(struct file * , char const * , size_t , loff_t * ) ; ssize_t (*aio_read)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; ssize_t (*aio_write)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; ssize_t (*read_iter)(struct kiocb * , struct iov_iter * ) ; ssize_t (*write_iter)(struct kiocb * , struct iov_iter * ) ; int (*iterate)(struct file * , struct dir_context * ) ; unsigned int (*poll)(struct file * , struct poll_table_struct * ) ; long (*unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; long (*compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*mmap)(struct file * , struct vm_area_struct * ) ; int (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; int (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , bool ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , char const * ) ; int (*mkdir)(struct inode * , struct dentry * , umode_t ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , umode_t , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; int (*rename2)(struct inode * , struct dentry * , struct inode * , struct dentry * , unsigned int ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; int (*update_time)(struct inode * , struct timespec * , int ) ; int (*atomic_open)(struct inode * , struct dentry * , struct file * , unsigned int , umode_t , int * ) ; int (*tmpfile)(struct inode * , struct dentry * , umode_t ) ; int (*set_acl)(struct inode * , struct posix_acl * , int ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_fs)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; long (*nr_cached_objects)(struct super_block * , int ) ; long (*free_cached_objects)(struct super_block * , long , int ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct hlist_head fs_supers ; struct lock_class_key s_lock_key ; struct lock_class_key s_umount_key ; struct lock_class_key s_vfs_rename_key ; struct lock_class_key s_writers_key[3U] ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; }; typedef unsigned long cputime_t; struct __anonstruct_sigset_t_191 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_191 sigset_t; struct siginfo; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_193 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_194 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_195 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_196 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_197 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_198 { long _band ; int _fd ; }; struct __anonstruct__sigsys_199 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_192 { int _pad[28U] ; struct __anonstruct__kill_193 _kill ; struct __anonstruct__timer_194 _timer ; struct __anonstruct__rt_195 _rt ; struct __anonstruct__sigchld_196 _sigchld ; struct __anonstruct__sigfault_197 _sigfault ; struct __anonstruct__sigpoll_198 _sigpoll ; struct __anonstruct__sigsys_199 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_192 _sifields ; }; typedef struct siginfo siginfo_t; struct sigpending { struct list_head list ; sigset_t signal ; }; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct rt_mutex_waiter; struct rlimit { __kernel_ulong_t rlim_cur ; __kernel_ulong_t rlim_max ; }; struct timerqueue_node { struct rb_node node ; ktime_t expires ; }; struct timerqueue_head { struct rb_root head ; struct timerqueue_node *next ; }; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct timerqueue_node node ; ktime_t _softexpires ; enum hrtimer_restart (*function)(struct hrtimer * ) ; struct hrtimer_clock_base *base ; unsigned long state ; int start_pid ; void *start_site ; char start_comm[16U] ; }; struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base ; int index ; clockid_t clockid ; struct timerqueue_head active ; ktime_t resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; unsigned int active_bases ; unsigned int clock_was_set ; ktime_t expires_next ; int hres_active ; int hang_detected ; unsigned long nr_events ; unsigned long nr_retries ; unsigned long nr_hangs ; ktime_t max_hang_time ; struct hrtimer_clock_base clock_base[4U] ; }; struct task_io_accounting { u64 rchar ; u64 wchar ; u64 syscr ; u64 syscw ; u64 read_bytes ; u64 write_bytes ; u64 cancelled_write_bytes ; }; struct latency_record { unsigned long backtrace[12U] ; unsigned int count ; unsigned long time ; unsigned long max ; }; struct assoc_array_ptr; struct assoc_array { struct assoc_array_ptr *root ; unsigned long nr_leaves_on_tree ; }; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_index_key { struct key_type *type ; char const *description ; size_t desc_len ; }; union __anonunion_ldv_26516_202 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion_ldv_26524_203 { time_t expiry ; time_t revoked_at ; }; struct __anonstruct_ldv_26537_205 { struct key_type *type ; char *description ; }; union __anonunion_ldv_26538_204 { struct keyring_index_key index_key ; struct __anonstruct_ldv_26537_205 ldv_26537 ; }; union __anonunion_type_data_206 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_208 { unsigned long value ; void *rcudata ; void *data ; void *data2[2U] ; }; union __anonunion_ldv_26553_207 { union __anonunion_payload_208 payload ; struct assoc_array keys ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion_ldv_26516_202 ldv_26516 ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion_ldv_26524_203 ldv_26524 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; union __anonunion_ldv_26538_204 ldv_26538 ; union __anonunion_type_data_206 type_data ; union __anonunion_ldv_26553_207 ldv_26553 ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; struct cred { atomic_t usage ; atomic_t subscribers ; void *put_addr ; unsigned int magic ; kuid_t uid ; kgid_t gid ; kuid_t suid ; kgid_t sgid ; kuid_t euid ; kgid_t egid ; kuid_t fsuid ; kgid_t fsgid ; unsigned int securebits ; kernel_cap_t cap_inheritable ; kernel_cap_t cap_permitted ; kernel_cap_t cap_effective ; kernel_cap_t cap_bset ; unsigned char jit_keyring ; struct key *session_keyring ; struct key *process_keyring ; struct key *thread_keyring ; struct key *request_key_auth ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct callback_head rcu ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct task_group; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; struct pacct_struct { int ac_flag ; long ac_exitcode ; unsigned long ac_mem ; cputime_t ac_utime ; cputime_t ac_stime ; unsigned long ac_minflt ; unsigned long ac_majflt ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct cputime { cputime_t utime ; cputime_t stime ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime cputime ; int running ; raw_spinlock_t lock ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; struct list_head thread_head ; wait_queue_head_t wait_chldexit ; struct task_struct *curr_target ; struct sigpending shared_pending ; int group_exit_code ; int notify_count ; struct task_struct *group_exit_task ; int group_stop_count ; unsigned int flags ; unsigned char is_child_subreaper : 1 ; unsigned char has_child_subreaper : 1 ; int posix_timer_id ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; unsigned int audit_tty_log_passwd ; struct tty_audit_buf *tty_audit_buf ; struct rw_semaphore group_rwsem ; oom_flags_t oom_flags ; short oom_score_adj ; short oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; kuid_t uid ; atomic_long_t locked_vm ; }; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; struct timespec blkio_start ; struct timespec blkio_end ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; struct timespec freepages_start ; struct timespec freepages_end ; u64 freepages_delay ; u32 freepages_count ; }; struct uts_namespace; struct load_weight { unsigned long weight ; u32 inv_weight ; }; struct sched_avg { u32 runnable_avg_sum ; u32 runnable_avg_period ; u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; int depth ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; struct sched_avg avg ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned long watchdog_stamp ; unsigned int time_slice ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct sched_dl_entity { struct rb_node rb_node ; u64 dl_runtime ; u64 dl_deadline ; u64 dl_period ; u64 dl_bw ; s64 runtime ; u64 deadline ; unsigned int flags ; int dl_throttled ; int dl_new ; int dl_boosted ; int dl_yielded ; struct hrtimer dl_timer ; }; struct memcg_batch_info { int do_batch ; struct mem_cgroup *memcg ; unsigned long nr_pages ; unsigned long memsw_nr_pages ; }; struct memcg_oom_info { struct mem_cgroup *memcg ; gfp_t gfp_mask ; int order ; unsigned char may_oom : 1 ; }; struct sched_class; struct css_set; struct compat_robust_list_head; struct numa_group; struct ftrace_ret_stack; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; struct llist_node wake_entry ; int on_cpu ; struct task_struct *last_wakee ; unsigned long wakee_flips ; unsigned long wakee_flip_decay_ts ; int wake_cpu ; int on_rq ; int prio ; int static_prio ; int normal_prio ; unsigned int rt_priority ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct task_group *sched_task_group ; struct sched_dl_entity dl ; struct hlist_head preempt_notifiers ; unsigned int btrace_seq ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct rb_node pushable_dl_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; unsigned char brk_randomized : 1 ; u32 vmacache_seqnum ; struct vm_area_struct *vmacache[4U] ; struct task_rss_stat rss_stat ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int jobctl ; unsigned int personality ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char no_new_privs : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; pid_t pid ; pid_t tgid ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct list_head thread_node ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; struct timespec start_time ; struct timespec real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; char comm[16U] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct callback_head *task_works ; struct audit_context *audit_context ; kuid_t loginuid ; unsigned int sessionid ; struct seccomp seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; raw_spinlock_t pi_lock ; struct rb_root pi_waiters ; struct rb_node *pi_waiters_leftmost ; struct rt_mutex_waiter *pi_blocked_on ; struct task_struct *pi_top_task ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; seqcount_t mems_allowed_seq ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; int numa_scan_seq ; unsigned int numa_scan_period ; unsigned int numa_scan_period_max ; int numa_preferred_nid ; unsigned long numa_migrate_retry ; u64 node_stamp ; u64 last_task_numa_placement ; u64 last_sum_exec_runtime ; struct callback_head numa_work ; struct list_head numa_entry ; struct numa_group *numa_group ; unsigned long *numa_faults_memory ; unsigned long total_numa_faults ; unsigned long *numa_faults_buffer_memory ; unsigned long *numa_faults_cpu ; unsigned long *numa_faults_buffer_cpu ; unsigned long numa_faults_locality[2U] ; unsigned long numa_pages_migrated ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; int curr_ret_stack ; struct ftrace_ret_stack *ret_stack ; unsigned long long ftrace_timestamp ; atomic_t trace_overrun ; atomic_t tracing_graph_pause ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_batch_info memcg_batch ; unsigned int memcg_kmem_skip_account ; struct memcg_oom_info memcg_oom ; struct uprobe_task *utask ; unsigned int sequential_io ; unsigned int sequential_io_avg ; }; typedef s32 compat_long_t; typedef u32 compat_uptr_t; struct compat_robust_list { compat_uptr_t next ; }; struct compat_robust_list_head { struct compat_robust_list list ; compat_long_t futex_offset ; compat_uptr_t list_op_pending ; }; enum ldv_22474 { SS_FREE = 0, SS_UNCONNECTED = 1, SS_CONNECTING = 2, SS_CONNECTED = 3, SS_DISCONNECTING = 4 } ; typedef enum ldv_22474 socket_state; struct socket_wq { wait_queue_head_t wait ; struct fasync_struct *fasync_list ; struct callback_head rcu ; }; struct proto_ops; struct socket { socket_state state ; short type ; unsigned long flags ; struct socket_wq *wq ; struct file *file ; struct sock *sk ; struct proto_ops const *ops ; }; struct proto_ops { int family ; struct module *owner ; int (*release)(struct socket * ) ; int (*bind)(struct socket * , struct sockaddr * , int ) ; int (*connect)(struct socket * , struct sockaddr * , int , int ) ; int (*socketpair)(struct socket * , struct socket * ) ; int (*accept)(struct socket * , struct socket * , int ) ; int (*getname)(struct socket * , struct sockaddr * , int * , int ) ; unsigned int (*poll)(struct file * , struct socket * , struct poll_table_struct * ) ; int (*ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*compat_ioctl)(struct socket * , unsigned int , unsigned long ) ; int (*listen)(struct socket * , int ) ; int (*shutdown)(struct socket * , int ) ; int (*setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct socket * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct socket * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct socket * , int , int , char * , int * ) ; int (*sendmsg)(struct kiocb * , struct socket * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , struct socket * , struct msghdr * , size_t , int ) ; int (*mmap)(struct file * , struct socket * , struct vm_area_struct * ) ; ssize_t (*sendpage)(struct socket * , struct page * , int , size_t , int ) ; ssize_t (*splice_read)(struct socket * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*set_peek_off)(struct sock * , int ) ; }; struct exception_table_entry { int insn ; int fixup ; }; struct in6_addr; struct sk_buff; struct dma_attrs { unsigned long flags[1U] ; }; enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ; struct dma_map_ops { void *(*alloc)(struct device * , size_t , dma_addr_t * , gfp_t , struct dma_attrs * ) ; void (*free)(struct device * , size_t , void * , dma_addr_t , struct dma_attrs * ) ; int (*mmap)(struct device * , struct vm_area_struct * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; int (*get_sgtable)(struct device * , struct sg_table * , void * , dma_addr_t , size_t , struct dma_attrs * ) ; dma_addr_t (*map_page)(struct device * , struct page * , unsigned long , size_t , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_page)(struct device * , dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs * ) ; int (*map_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*unmap_sg)(struct device * , struct scatterlist * , int , enum dma_data_direction , struct dma_attrs * ) ; void (*sync_single_for_cpu)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_single_for_device)(struct device * , dma_addr_t , size_t , enum dma_data_direction ) ; void (*sync_sg_for_cpu)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; void (*sync_sg_for_device)(struct device * , struct scatterlist * , int , enum dma_data_direction ) ; int (*mapping_error)(struct device * , dma_addr_t ) ; int (*dma_supported)(struct device * , u64 ) ; int (*set_dma_mask)(struct device * , u64 ) ; int is_phys ; }; typedef u64 netdev_features_t; struct nf_conntrack { atomic_t use ; }; struct nf_bridge_info { atomic_t use ; unsigned int mask ; struct net_device *physindev ; struct net_device *physoutdev ; unsigned long data[4U] ; }; struct sk_buff_head { struct sk_buff *next ; struct sk_buff *prev ; __u32 qlen ; spinlock_t lock ; }; typedef unsigned int sk_buff_data_t; struct __anonstruct_ldv_30956_227 { u32 stamp_us ; u32 stamp_jiffies ; }; union __anonunion_ldv_30957_226 { u64 v64 ; struct __anonstruct_ldv_30956_227 ldv_30956 ; }; struct skb_mstamp { union __anonunion_ldv_30957_226 ldv_30957 ; }; union __anonunion_ldv_30976_228 { ktime_t tstamp ; struct skb_mstamp skb_mstamp ; }; struct sec_path; struct __anonstruct_ldv_30992_230 { __u16 csum_start ; __u16 csum_offset ; }; union __anonunion_ldv_30993_229 { __wsum csum ; struct __anonstruct_ldv_30992_230 ldv_30992 ; }; union __anonunion_ldv_31032_231 { unsigned int napi_id ; dma_cookie_t dma_cookie ; }; union __anonunion_ldv_31038_232 { __u32 mark ; __u32 dropcount ; __u32 reserved_tailroom ; }; struct sk_buff { struct sk_buff *next ; struct sk_buff *prev ; union __anonunion_ldv_30976_228 ldv_30976 ; struct sock *sk ; struct net_device *dev ; char cb[48U] ; unsigned long _skb_refdst ; struct sec_path *sp ; unsigned int len ; unsigned int data_len ; __u16 mac_len ; __u16 hdr_len ; union __anonunion_ldv_30993_229 ldv_30993 ; __u32 priority ; unsigned char ignore_df : 1 ; unsigned char cloned : 1 ; unsigned char ip_summed : 2 ; unsigned char nohdr : 1 ; unsigned char nfctinfo : 3 ; unsigned char pkt_type : 3 ; unsigned char fclone : 2 ; unsigned char ipvs_property : 1 ; unsigned char peeked : 1 ; unsigned char nf_trace : 1 ; __be16 protocol ; void (*destructor)(struct sk_buff * ) ; struct nf_conntrack *nfct ; struct nf_bridge_info *nf_bridge ; int skb_iif ; __u32 hash ; __be16 vlan_proto ; __u16 vlan_tci ; __u16 tc_index ; __u16 tc_verd ; __u16 queue_mapping ; unsigned char ndisc_nodetype : 2 ; unsigned char pfmemalloc : 1 ; unsigned char ooo_okay : 1 ; unsigned char l4_hash : 1 ; unsigned char wifi_acked_valid : 1 ; unsigned char wifi_acked : 1 ; unsigned char no_fcs : 1 ; unsigned char head_frag : 1 ; unsigned char encapsulation : 1 ; unsigned char encap_hdr_csum : 1 ; unsigned char csum_valid : 1 ; unsigned char csum_complete_sw : 1 ; union __anonunion_ldv_31032_231 ldv_31032 ; __u32 secmark ; union __anonunion_ldv_31038_232 ldv_31038 ; __be16 inner_protocol ; __u16 inner_transport_header ; __u16 inner_network_header ; __u16 inner_mac_header ; __u16 transport_header ; __u16 network_header ; __u16 mac_header ; sk_buff_data_t tail ; sk_buff_data_t end ; unsigned char *head ; unsigned char *data ; unsigned int truesize ; atomic_t users ; }; struct dst_entry; struct rtable; struct ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_proto ; }; struct ethtool_cmd { __u32 cmd ; __u32 supported ; __u32 advertising ; __u16 speed ; __u8 duplex ; __u8 port ; __u8 phy_address ; __u8 transceiver ; __u8 autoneg ; __u8 mdio_support ; __u32 maxtxpkt ; __u32 maxrxpkt ; __u16 speed_hi ; __u8 eth_tp_mdix ; __u8 eth_tp_mdix_ctrl ; __u32 lp_advertising ; __u32 reserved[2U] ; }; struct ethtool_drvinfo { __u32 cmd ; char driver[32U] ; char version[32U] ; char fw_version[32U] ; char bus_info[32U] ; char reserved1[32U] ; char reserved2[12U] ; __u32 n_priv_flags ; __u32 n_stats ; __u32 testinfo_len ; __u32 eedump_len ; __u32 regdump_len ; }; struct ethtool_wolinfo { __u32 cmd ; __u32 supported ; __u32 wolopts ; __u8 sopass[6U] ; }; struct ethtool_regs { __u32 cmd ; __u32 version ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eeprom { __u32 cmd ; __u32 magic ; __u32 offset ; __u32 len ; __u8 data[0U] ; }; struct ethtool_eee { __u32 cmd ; __u32 supported ; __u32 advertised ; __u32 lp_advertised ; __u32 eee_active ; __u32 eee_enabled ; __u32 tx_lpi_enabled ; __u32 tx_lpi_timer ; __u32 reserved[2U] ; }; struct ethtool_modinfo { __u32 cmd ; __u32 type ; __u32 eeprom_len ; __u32 reserved[8U] ; }; struct ethtool_coalesce { __u32 cmd ; __u32 rx_coalesce_usecs ; __u32 rx_max_coalesced_frames ; __u32 rx_coalesce_usecs_irq ; __u32 rx_max_coalesced_frames_irq ; __u32 tx_coalesce_usecs ; __u32 tx_max_coalesced_frames ; __u32 tx_coalesce_usecs_irq ; __u32 tx_max_coalesced_frames_irq ; __u32 stats_block_coalesce_usecs ; __u32 use_adaptive_rx_coalesce ; __u32 use_adaptive_tx_coalesce ; __u32 pkt_rate_low ; __u32 rx_coalesce_usecs_low ; __u32 rx_max_coalesced_frames_low ; __u32 tx_coalesce_usecs_low ; __u32 tx_max_coalesced_frames_low ; __u32 pkt_rate_high ; __u32 rx_coalesce_usecs_high ; __u32 rx_max_coalesced_frames_high ; __u32 tx_coalesce_usecs_high ; __u32 tx_max_coalesced_frames_high ; __u32 rate_sample_interval ; }; struct ethtool_ringparam { __u32 cmd ; __u32 rx_max_pending ; __u32 rx_mini_max_pending ; __u32 rx_jumbo_max_pending ; __u32 tx_max_pending ; __u32 rx_pending ; __u32 rx_mini_pending ; __u32 rx_jumbo_pending ; __u32 tx_pending ; }; struct ethtool_channels { __u32 cmd ; __u32 max_rx ; __u32 max_tx ; __u32 max_other ; __u32 max_combined ; __u32 rx_count ; __u32 tx_count ; __u32 other_count ; __u32 combined_count ; }; struct ethtool_pauseparam { __u32 cmd ; __u32 autoneg ; __u32 rx_pause ; __u32 tx_pause ; }; struct ethtool_test { __u32 cmd ; __u32 flags ; __u32 reserved ; __u32 len ; __u64 data[0U] ; }; struct ethtool_stats { __u32 cmd ; __u32 n_stats ; __u64 data[0U] ; }; struct ethtool_tcpip4_spec { __be32 ip4src ; __be32 ip4dst ; __be16 psrc ; __be16 pdst ; __u8 tos ; }; struct ethtool_ah_espip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 spi ; __u8 tos ; }; struct ethtool_usrip4_spec { __be32 ip4src ; __be32 ip4dst ; __be32 l4_4_bytes ; __u8 tos ; __u8 ip_ver ; __u8 proto ; }; union ethtool_flow_union { struct ethtool_tcpip4_spec tcp_ip4_spec ; struct ethtool_tcpip4_spec udp_ip4_spec ; struct ethtool_tcpip4_spec sctp_ip4_spec ; struct ethtool_ah_espip4_spec ah_ip4_spec ; struct ethtool_ah_espip4_spec esp_ip4_spec ; struct ethtool_usrip4_spec usr_ip4_spec ; struct ethhdr ether_spec ; __u8 hdata[52U] ; }; struct ethtool_flow_ext { __u8 padding[2U] ; unsigned char h_dest[6U] ; __be16 vlan_etype ; __be16 vlan_tci ; __be32 data[2U] ; }; struct ethtool_rx_flow_spec { __u32 flow_type ; union ethtool_flow_union h_u ; struct ethtool_flow_ext h_ext ; union ethtool_flow_union m_u ; struct ethtool_flow_ext m_ext ; __u64 ring_cookie ; __u32 location ; }; struct ethtool_rxnfc { __u32 cmd ; __u32 flow_type ; __u64 data ; struct ethtool_rx_flow_spec fs ; __u32 rule_cnt ; __u32 rule_locs[0U] ; }; struct ethtool_flash { __u32 cmd ; __u32 region ; char data[128U] ; }; struct ethtool_dump { __u32 cmd ; __u32 version ; __u32 flag ; __u32 len ; __u8 data[0U] ; }; struct ethtool_ts_info { __u32 cmd ; __u32 so_timestamping ; __s32 phc_index ; __u32 tx_types ; __u32 tx_reserved[3U] ; __u32 rx_filters ; __u32 rx_reserved[3U] ; }; enum ethtool_phys_id_state { ETHTOOL_ID_INACTIVE = 0, ETHTOOL_ID_ACTIVE = 1, ETHTOOL_ID_ON = 2, ETHTOOL_ID_OFF = 3 } ; struct ethtool_ops { int (*get_settings)(struct net_device * , struct ethtool_cmd * ) ; int (*set_settings)(struct net_device * , struct ethtool_cmd * ) ; void (*get_drvinfo)(struct net_device * , struct ethtool_drvinfo * ) ; int (*get_regs_len)(struct net_device * ) ; void (*get_regs)(struct net_device * , struct ethtool_regs * , void * ) ; void (*get_wol)(struct net_device * , struct ethtool_wolinfo * ) ; int (*set_wol)(struct net_device * , struct ethtool_wolinfo * ) ; u32 (*get_msglevel)(struct net_device * ) ; void (*set_msglevel)(struct net_device * , u32 ) ; int (*nway_reset)(struct net_device * ) ; u32 (*get_link)(struct net_device * ) ; int (*get_eeprom_len)(struct net_device * ) ; int (*get_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*set_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; int (*set_coalesce)(struct net_device * , struct ethtool_coalesce * ) ; void (*get_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; int (*set_ringparam)(struct net_device * , struct ethtool_ringparam * ) ; void (*get_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; int (*set_pauseparam)(struct net_device * , struct ethtool_pauseparam * ) ; void (*self_test)(struct net_device * , struct ethtool_test * , u64 * ) ; void (*get_strings)(struct net_device * , u32 , u8 * ) ; int (*set_phys_id)(struct net_device * , enum ethtool_phys_id_state ) ; void (*get_ethtool_stats)(struct net_device * , struct ethtool_stats * , u64 * ) ; int (*begin)(struct net_device * ) ; void (*complete)(struct net_device * ) ; u32 (*get_priv_flags)(struct net_device * ) ; int (*set_priv_flags)(struct net_device * , u32 ) ; int (*get_sset_count)(struct net_device * , int ) ; int (*get_rxnfc)(struct net_device * , struct ethtool_rxnfc * , u32 * ) ; int (*set_rxnfc)(struct net_device * , struct ethtool_rxnfc * ) ; int (*flash_device)(struct net_device * , struct ethtool_flash * ) ; int (*reset)(struct net_device * , u32 * ) ; u32 (*get_rxfh_key_size)(struct net_device * ) ; u32 (*get_rxfh_indir_size)(struct net_device * ) ; int (*get_rxfh)(struct net_device * , u32 * , u8 * ) ; int (*set_rxfh)(struct net_device * , u32 const * , u8 const * ) ; void (*get_channels)(struct net_device * , struct ethtool_channels * ) ; int (*set_channels)(struct net_device * , struct ethtool_channels * ) ; int (*get_dump_flag)(struct net_device * , struct ethtool_dump * ) ; int (*get_dump_data)(struct net_device * , struct ethtool_dump * , void * ) ; int (*set_dump)(struct net_device * , struct ethtool_dump * ) ; int (*get_ts_info)(struct net_device * , struct ethtool_ts_info * ) ; int (*get_module_info)(struct net_device * , struct ethtool_modinfo * ) ; int (*get_module_eeprom)(struct net_device * , struct ethtool_eeprom * , u8 * ) ; int (*get_eee)(struct net_device * , struct ethtool_eee * ) ; int (*set_eee)(struct net_device * , struct ethtool_eee * ) ; }; union __anonunion_in6_u_235 { __u8 u6_addr8[16U] ; __be16 u6_addr16[8U] ; __be32 u6_addr32[4U] ; }; struct in6_addr { union __anonunion_in6_u_235 in6_u ; }; struct prot_inuse; struct netns_core { struct ctl_table_header *sysctl_hdr ; int sysctl_somaxconn ; struct prot_inuse *inuse ; }; struct u64_stats_sync { }; struct ipstats_mib { u64 mibs[36U] ; struct u64_stats_sync syncp ; }; struct icmp_mib { unsigned long mibs[28U] ; }; struct icmpmsg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6_mib { unsigned long mibs[6U] ; }; struct icmpv6_mib_device { atomic_long_t mibs[6U] ; }; struct icmpv6msg_mib { atomic_long_t mibs[512U] ; }; struct icmpv6msg_mib_device { atomic_long_t mibs[512U] ; }; struct tcp_mib { unsigned long mibs[16U] ; }; struct udp_mib { unsigned long mibs[8U] ; }; struct linux_mib { unsigned long mibs[103U] ; }; struct linux_xfrm_mib { unsigned long mibs[29U] ; }; struct proc_dir_entry; struct netns_mib { struct tcp_mib *tcp_statistics ; struct ipstats_mib *ip_statistics ; struct linux_mib *net_statistics ; struct udp_mib *udp_statistics ; struct udp_mib *udplite_statistics ; struct icmp_mib *icmp_statistics ; struct icmpmsg_mib *icmpmsg_statistics ; struct proc_dir_entry *proc_net_devsnmp6 ; struct udp_mib *udp_stats_in6 ; struct udp_mib *udplite_stats_in6 ; struct ipstats_mib *ipv6_statistics ; struct icmpv6_mib *icmpv6_statistics ; struct icmpv6msg_mib *icmpv6msg_statistics ; struct linux_xfrm_mib *xfrm_statistics ; }; struct netns_unix { int sysctl_max_dgram_qlen ; struct ctl_table_header *ctl ; }; struct netns_packet { struct mutex sklist_lock ; struct hlist_head sklist ; }; struct netns_frags { int nqueues ; struct list_head lru_list ; spinlock_t lru_lock ; struct percpu_counter mem ; int timeout ; int high_thresh ; int low_thresh ; }; struct tcpm_hash_bucket; struct ipv4_devconf; struct fib_rules_ops; struct fib_table; struct local_ports { seqlock_t lock ; int range[2U] ; }; struct ping_group_range { seqlock_t lock ; kgid_t range[2U] ; }; struct inet_peer_base; struct xt_table; struct netns_ipv4 { struct ctl_table_header *forw_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *ipv4_hdr ; struct ctl_table_header *route_hdr ; struct ctl_table_header *xfrm4_hdr ; struct ipv4_devconf *devconf_all ; struct ipv4_devconf *devconf_dflt ; struct fib_rules_ops *rules_ops ; bool fib_has_custom_rules ; struct fib_table *fib_local ; struct fib_table *fib_main ; struct fib_table *fib_default ; int fib_num_tclassid_users ; struct hlist_head *fib_table_hash ; struct sock *fibnl ; struct sock **icmp_sk ; struct inet_peer_base *peers ; struct tcpm_hash_bucket *tcp_metrics_hash ; unsigned int tcp_metrics_hash_log ; struct netns_frags frags ; struct xt_table *iptable_filter ; struct xt_table *iptable_mangle ; struct xt_table *iptable_raw ; struct xt_table *arptable_filter ; struct xt_table *iptable_security ; struct xt_table *nat_table ; int sysctl_icmp_echo_ignore_all ; int sysctl_icmp_echo_ignore_broadcasts ; int sysctl_icmp_ignore_bogus_error_responses ; int sysctl_icmp_ratelimit ; int sysctl_icmp_ratemask ; int sysctl_icmp_errors_use_inbound_ifaddr ; struct local_ports ip_local_ports ; int sysctl_tcp_ecn ; int sysctl_ip_no_pmtu_disc ; int sysctl_ip_fwd_use_pmtu ; int sysctl_fwmark_reflect ; int sysctl_tcp_fwmark_accept ; struct ping_group_range ping_group_range ; atomic_t dev_addr_genid ; unsigned long *sysctl_local_reserved_ports ; struct list_head mr_tables ; struct fib_rules_ops *mr_rules_ops ; atomic_t rt_genid ; }; struct neighbour; struct dst_ops { unsigned short family ; __be16 protocol ; unsigned int gc_thresh ; int (*gc)(struct dst_ops * ) ; struct dst_entry *(*check)(struct dst_entry * , __u32 ) ; unsigned int (*default_advmss)(struct dst_entry const * ) ; unsigned int (*mtu)(struct dst_entry const * ) ; u32 *(*cow_metrics)(struct dst_entry * , unsigned long ) ; void (*destroy)(struct dst_entry * ) ; void (*ifdown)(struct dst_entry * , struct net_device * , int ) ; struct dst_entry *(*negative_advice)(struct dst_entry * ) ; void (*link_failure)(struct sk_buff * ) ; void (*update_pmtu)(struct dst_entry * , struct sock * , struct sk_buff * , u32 ) ; void (*redirect)(struct dst_entry * , struct sock * , struct sk_buff * ) ; int (*local_out)(struct sk_buff * ) ; struct neighbour *(*neigh_lookup)(struct dst_entry const * , struct sk_buff * , void const * ) ; struct kmem_cache *kmem_cachep ; struct percpu_counter pcpuc_entries ; }; struct netns_sysctl_ipv6 { struct ctl_table_header *hdr ; struct ctl_table_header *route_hdr ; struct ctl_table_header *icmp_hdr ; struct ctl_table_header *frags_hdr ; struct ctl_table_header *xfrm6_hdr ; int bindv6only ; int flush_delay ; int ip6_rt_max_size ; int ip6_rt_gc_min_interval ; int ip6_rt_gc_timeout ; int ip6_rt_gc_interval ; int ip6_rt_gc_elasticity ; int ip6_rt_mtu_expires ; int ip6_rt_min_advmss ; int flowlabel_consistency ; int icmpv6_time ; int anycast_src_echo_reply ; int fwmark_reflect ; }; struct ipv6_devconf; struct rt6_info; struct rt6_statistics; struct fib6_table; struct netns_ipv6 { struct netns_sysctl_ipv6 sysctl ; struct ipv6_devconf *devconf_all ; struct ipv6_devconf *devconf_dflt ; struct inet_peer_base *peers ; struct netns_frags frags ; struct xt_table *ip6table_filter ; struct xt_table *ip6table_mangle ; struct xt_table *ip6table_raw ; struct xt_table *ip6table_security ; struct xt_table *ip6table_nat ; struct rt6_info *ip6_null_entry ; struct rt6_statistics *rt6_stats ; struct timer_list ip6_fib_timer ; struct hlist_head *fib_table_hash ; struct fib6_table *fib6_main_tbl ; struct dst_ops ip6_dst_ops ; unsigned int ip6_rt_gc_expire ; unsigned long ip6_rt_last_gc ; struct rt6_info *ip6_prohibit_entry ; struct rt6_info *ip6_blk_hole_entry ; struct fib6_table *fib6_local_tbl ; struct fib_rules_ops *fib6_rules_ops ; struct sock **icmp_sk ; struct sock *ndisc_sk ; struct sock *tcp_sk ; struct sock *igmp_sk ; struct list_head mr6_tables ; struct fib_rules_ops *mr6_rules_ops ; atomic_t dev_addr_genid ; atomic_t rt_genid ; }; struct netns_nf_frag { struct netns_sysctl_ipv6 sysctl ; struct netns_frags frags ; }; struct netns_sysctl_lowpan { struct ctl_table_header *frags_hdr ; }; struct netns_ieee802154_lowpan { struct netns_sysctl_lowpan sysctl ; struct netns_frags frags ; u16 max_dsize ; }; struct sctp_mib; struct netns_sctp { struct sctp_mib *sctp_statistics ; struct proc_dir_entry *proc_net_sctp ; struct ctl_table_header *sysctl_header ; struct sock *ctl_sock ; struct list_head local_addr_list ; struct list_head addr_waitq ; struct timer_list addr_wq_timer ; struct list_head auto_asconf_splist ; spinlock_t addr_wq_lock ; spinlock_t local_addr_lock ; unsigned int rto_initial ; unsigned int rto_min ; unsigned int rto_max ; int rto_alpha ; int rto_beta ; int max_burst ; int cookie_preserve_enable ; char *sctp_hmac_alg ; unsigned int valid_cookie_life ; unsigned int sack_timeout ; unsigned int hb_interval ; int max_retrans_association ; int max_retrans_path ; int max_retrans_init ; int pf_retrans ; int sndbuf_policy ; int rcvbuf_policy ; int default_auto_asconf ; int addip_enable ; int addip_noauth ; int prsctp_enable ; int auth_enable ; int scope_policy ; int rwnd_upd_shift ; unsigned long max_autoclose ; }; struct netns_dccp { struct sock *v4_ctl_sk ; struct sock *v6_ctl_sk ; }; struct nlattr; struct nf_logger; struct netns_nf { struct proc_dir_entry *proc_netfilter ; struct nf_logger const *nf_loggers[13U] ; struct ctl_table_header *nf_log_dir_header ; }; struct ebt_table; struct netns_xt { struct list_head tables[13U] ; bool notrack_deprecated_warning ; struct ebt_table *broute_table ; struct ebt_table *frame_filter ; struct ebt_table *frame_nat ; bool ulog_warn_deprecated ; bool ebt_ulog_warn_deprecated ; }; struct hlist_nulls_node; struct hlist_nulls_head { struct hlist_nulls_node *first ; }; struct hlist_nulls_node { struct hlist_nulls_node *next ; struct hlist_nulls_node **pprev ; }; struct nf_proto_net { struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; struct ctl_table_header *ctl_compat_header ; struct ctl_table *ctl_compat_table ; unsigned int users ; }; struct nf_generic_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_tcp_net { struct nf_proto_net pn ; unsigned int timeouts[14U] ; unsigned int tcp_loose ; unsigned int tcp_be_liberal ; unsigned int tcp_max_retrans ; }; struct nf_udp_net { struct nf_proto_net pn ; unsigned int timeouts[2U] ; }; struct nf_icmp_net { struct nf_proto_net pn ; unsigned int timeout ; }; struct nf_ip_net { struct nf_generic_net generic ; struct nf_tcp_net tcp ; struct nf_udp_net udp ; struct nf_icmp_net icmp ; struct nf_icmp_net icmpv6 ; struct ctl_table_header *ctl_table_header ; struct ctl_table *ctl_table ; }; struct ct_pcpu { spinlock_t lock ; struct hlist_nulls_head unconfirmed ; struct hlist_nulls_head dying ; struct hlist_nulls_head tmpl ; }; struct ip_conntrack_stat; struct nf_ct_event_notifier; struct nf_exp_event_notifier; struct netns_ct { atomic_t count ; unsigned int expect_count ; struct ctl_table_header *sysctl_header ; struct ctl_table_header *acct_sysctl_header ; struct ctl_table_header *tstamp_sysctl_header ; struct ctl_table_header *event_sysctl_header ; struct ctl_table_header *helper_sysctl_header ; char *slabname ; unsigned int sysctl_log_invalid ; unsigned int sysctl_events_retry_timeout ; int sysctl_events ; int sysctl_acct ; int sysctl_auto_assign_helper ; bool auto_assign_helper_warned ; int sysctl_tstamp ; int sysctl_checksum ; unsigned int htable_size ; seqcount_t generation ; struct kmem_cache *nf_conntrack_cachep ; struct hlist_nulls_head *hash ; struct hlist_head *expect_hash ; struct ct_pcpu *pcpu_lists ; struct ip_conntrack_stat *stat ; struct nf_ct_event_notifier *nf_conntrack_event_cb ; struct nf_exp_event_notifier *nf_expect_event_cb ; struct nf_ip_net nf_ct_proto ; unsigned int labels_used ; u8 label_words ; struct hlist_head *nat_bysource ; unsigned int nat_htable_size ; }; struct nft_af_info; struct netns_nftables { struct list_head af_info ; struct list_head commit_list ; struct nft_af_info *ipv4 ; struct nft_af_info *ipv6 ; struct nft_af_info *inet ; struct nft_af_info *arp ; struct nft_af_info *bridge ; u8 gencursor ; u8 genctr ; }; struct tasklet_struct { struct tasklet_struct *next ; unsigned long state ; atomic_t count ; void (*func)(unsigned long ) ; unsigned long data ; }; struct flow_cache_percpu { struct hlist_head *hash_table ; int hash_count ; u32 hash_rnd ; int hash_rnd_recalc ; struct tasklet_struct flush_tasklet ; }; struct flow_cache { u32 hash_shift ; struct flow_cache_percpu *percpu ; struct notifier_block hotcpu_notifier ; int low_watermark ; int high_watermark ; struct timer_list rnd_timer ; }; struct xfrm_policy_hash { struct hlist_head *table ; unsigned int hmask ; }; struct netns_xfrm { struct list_head state_all ; struct hlist_head *state_bydst ; struct hlist_head *state_bysrc ; struct hlist_head *state_byspi ; unsigned int state_hmask ; unsigned int state_num ; struct work_struct state_hash_work ; struct hlist_head state_gc_list ; struct work_struct state_gc_work ; struct list_head policy_all ; struct hlist_head *policy_byidx ; unsigned int policy_idx_hmask ; struct hlist_head policy_inexact[6U] ; struct xfrm_policy_hash policy_bydst[6U] ; unsigned int policy_count[6U] ; struct work_struct policy_hash_work ; struct sock *nlsk ; struct sock *nlsk_stash ; u32 sysctl_aevent_etime ; u32 sysctl_aevent_rseqth ; int sysctl_larval_drop ; u32 sysctl_acq_expires ; struct ctl_table_header *sysctl_hdr ; struct dst_ops xfrm4_dst_ops ; struct dst_ops xfrm6_dst_ops ; spinlock_t xfrm_state_lock ; rwlock_t xfrm_policy_lock ; struct mutex xfrm_cfg_mutex ; struct flow_cache flow_cache_global ; atomic_t flow_cache_genid ; struct list_head flow_cache_gc_list ; spinlock_t flow_cache_gc_lock ; struct work_struct flow_cache_gc_work ; struct work_struct flow_cache_flush_work ; struct mutex flow_flush_sem ; }; struct net_generic; struct netns_ipvs; struct net { atomic_t passive ; atomic_t count ; spinlock_t rules_mod_lock ; struct list_head list ; struct list_head cleanup_list ; struct list_head exit_list ; struct user_namespace *user_ns ; unsigned int proc_inum ; struct proc_dir_entry *proc_net ; struct proc_dir_entry *proc_net_stat ; struct ctl_table_set sysctls ; struct sock *rtnl ; struct sock *genl_sock ; struct list_head dev_base_head ; struct hlist_head *dev_name_head ; struct hlist_head *dev_index_head ; unsigned int dev_base_seq ; int ifindex ; unsigned int dev_unreg_count ; struct list_head rules_ops ; struct net_device *loopback_dev ; struct netns_core core ; struct netns_mib mib ; struct netns_packet packet ; struct netns_unix unx ; struct netns_ipv4 ipv4 ; struct netns_ipv6 ipv6 ; struct netns_ieee802154_lowpan ieee802154_lowpan ; struct netns_sctp sctp ; struct netns_dccp dccp ; struct netns_nf nf ; struct netns_xt xt ; struct netns_ct ct ; struct netns_nftables nft ; struct netns_nf_frag nf_frag ; struct sock *nfnl ; struct sock *nfnl_stash ; struct sk_buff_head wext_nlevents ; struct net_generic *gen ; struct netns_xfrm xfrm ; struct netns_ipvs *ipvs ; struct sock *diag_nlsk ; atomic_t fnhe_genid ; }; struct dsa_chip_data { struct device *mii_bus ; int sw_addr ; char *port_names[12U] ; s8 *rtable ; }; struct dsa_platform_data { struct device *netdev ; int nr_chips ; struct dsa_chip_data *chip ; }; struct dsa_switch; struct dsa_switch_tree { struct dsa_platform_data *pd ; struct net_device *master_netdev ; __be16 tag_protocol ; s8 cpu_switch ; s8 cpu_port ; int link_poll_needed ; struct work_struct link_poll_work ; struct timer_list link_poll_timer ; struct dsa_switch *ds[4U] ; }; struct dsa_switch_driver; struct mii_bus; struct dsa_switch { struct dsa_switch_tree *dst ; int index ; struct dsa_chip_data *pd ; struct dsa_switch_driver *drv ; struct mii_bus *master_mii_bus ; u32 dsa_port_mask ; u32 phys_port_mask ; struct mii_bus *slave_mii_bus ; struct net_device *ports[12U] ; }; struct dsa_switch_driver { struct list_head list ; __be16 tag_protocol ; int priv_size ; char *(*probe)(struct mii_bus * , int ) ; int (*setup)(struct dsa_switch * ) ; int (*set_addr)(struct dsa_switch * , u8 * ) ; int (*phy_read)(struct dsa_switch * , int , int ) ; int (*phy_write)(struct dsa_switch * , int , int , u16 ) ; void (*poll_link)(struct dsa_switch * ) ; void (*get_strings)(struct dsa_switch * , int , uint8_t * ) ; void (*get_ethtool_stats)(struct dsa_switch * , int , uint64_t * ) ; int (*get_sset_count)(struct dsa_switch * ) ; }; struct ieee_ets { __u8 willing ; __u8 ets_cap ; __u8 cbs ; __u8 tc_tx_bw[8U] ; __u8 tc_rx_bw[8U] ; __u8 tc_tsa[8U] ; __u8 prio_tc[8U] ; __u8 tc_reco_bw[8U] ; __u8 tc_reco_tsa[8U] ; __u8 reco_prio_tc[8U] ; }; struct ieee_maxrate { __u64 tc_maxrate[8U] ; }; struct ieee_pfc { __u8 pfc_cap ; __u8 pfc_en ; __u8 mbc ; __u16 delay ; __u64 requests[8U] ; __u64 indications[8U] ; }; struct cee_pg { __u8 willing ; __u8 error ; __u8 pg_en ; __u8 tcs_supported ; __u8 pg_bw[8U] ; __u8 prio_pg[8U] ; }; struct cee_pfc { __u8 willing ; __u8 error ; __u8 pfc_en ; __u8 tcs_supported ; }; struct dcb_app { __u8 selector ; __u8 priority ; __u16 protocol ; }; struct dcb_peer_app_info { __u8 willing ; __u8 error ; }; struct dcbnl_rtnl_ops { int (*ieee_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_setets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_getmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_setmaxrate)(struct net_device * , struct ieee_maxrate * ) ; int (*ieee_getpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_setpfc)(struct net_device * , struct ieee_pfc * ) ; int (*ieee_getapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_setapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_delapp)(struct net_device * , struct dcb_app * ) ; int (*ieee_peer_getets)(struct net_device * , struct ieee_ets * ) ; int (*ieee_peer_getpfc)(struct net_device * , struct ieee_pfc * ) ; u8 (*getstate)(struct net_device * ) ; u8 (*setstate)(struct net_device * , u8 ) ; void (*getpermhwaddr)(struct net_device * , u8 * ) ; void (*setpgtccfgtx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgtx)(struct net_device * , int , u8 ) ; void (*setpgtccfgrx)(struct net_device * , int , u8 , u8 , u8 , u8 ) ; void (*setpgbwgcfgrx)(struct net_device * , int , u8 ) ; void (*getpgtccfgtx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgtx)(struct net_device * , int , u8 * ) ; void (*getpgtccfgrx)(struct net_device * , int , u8 * , u8 * , u8 * , u8 * ) ; void (*getpgbwgcfgrx)(struct net_device * , int , u8 * ) ; void (*setpfccfg)(struct net_device * , int , u8 ) ; void (*getpfccfg)(struct net_device * , int , u8 * ) ; u8 (*setall)(struct net_device * ) ; u8 (*getcap)(struct net_device * , int , u8 * ) ; int (*getnumtcs)(struct net_device * , int , u8 * ) ; int (*setnumtcs)(struct net_device * , int , u8 ) ; u8 (*getpfcstate)(struct net_device * ) ; void (*setpfcstate)(struct net_device * , u8 ) ; void (*getbcncfg)(struct net_device * , int , u32 * ) ; void (*setbcncfg)(struct net_device * , int , u32 ) ; void (*getbcnrp)(struct net_device * , int , u8 * ) ; void (*setbcnrp)(struct net_device * , int , u8 ) ; u8 (*setapp)(struct net_device * , u8 , u16 , u8 ) ; u8 (*getapp)(struct net_device * , u8 , u16 ) ; u8 (*getfeatcfg)(struct net_device * , int , u8 * ) ; u8 (*setfeatcfg)(struct net_device * , int , u8 ) ; u8 (*getdcbx)(struct net_device * ) ; u8 (*setdcbx)(struct net_device * , u8 ) ; int (*peer_getappinfo)(struct net_device * , struct dcb_peer_app_info * , u16 * ) ; int (*peer_getapptable)(struct net_device * , struct dcb_app * ) ; int (*cee_peer_getpg)(struct net_device * , struct cee_pg * ) ; int (*cee_peer_getpfc)(struct net_device * , struct cee_pfc * ) ; }; struct taskstats { __u16 version ; __u32 ac_exitcode ; __u8 ac_flag ; __u8 ac_nice ; __u64 cpu_count ; __u64 cpu_delay_total ; __u64 blkio_count ; __u64 blkio_delay_total ; __u64 swapin_count ; __u64 swapin_delay_total ; __u64 cpu_run_real_total ; __u64 cpu_run_virtual_total ; char ac_comm[32U] ; __u8 ac_sched ; __u8 ac_pad[3U] ; __u32 ac_uid ; __u32 ac_gid ; __u32 ac_pid ; __u32 ac_ppid ; __u32 ac_btime ; __u64 ac_etime ; __u64 ac_utime ; __u64 ac_stime ; __u64 ac_minflt ; __u64 ac_majflt ; __u64 coremem ; __u64 virtmem ; __u64 hiwater_rss ; __u64 hiwater_vm ; __u64 read_char ; __u64 write_char ; __u64 read_syscalls ; __u64 write_syscalls ; __u64 read_bytes ; __u64 write_bytes ; __u64 cancelled_write_bytes ; __u64 nvcsw ; __u64 nivcsw ; __u64 ac_utimescaled ; __u64 ac_stimescaled ; __u64 cpu_scaled_run_real_total ; __u64 freepages_count ; __u64 freepages_delay_total ; }; struct percpu_ref; typedef void percpu_ref_func_t(struct percpu_ref * ); struct percpu_ref { atomic_t count ; unsigned int *pcpu_count ; percpu_ref_func_t *release ; percpu_ref_func_t *confirm_kill ; struct callback_head rcu ; }; struct cgroup_root; struct cgroup_subsys; struct cgroup; struct cgroup_subsys_state { struct cgroup *cgroup ; struct cgroup_subsys *ss ; struct percpu_ref refcnt ; struct cgroup_subsys_state *parent ; struct list_head sibling ; struct list_head children ; int id ; unsigned int flags ; u64 serial_nr ; struct callback_head callback_head ; struct work_struct destroy_work ; }; struct cgroup { struct cgroup_subsys_state self ; unsigned long flags ; int id ; int populated_cnt ; struct kernfs_node *kn ; struct kernfs_node *populated_kn ; unsigned int child_subsys_mask ; struct cgroup_subsys_state *subsys[12U] ; struct cgroup_root *root ; struct list_head cset_links ; struct list_head e_csets[12U] ; struct list_head release_list ; struct list_head pidlists ; struct mutex pidlist_mutex ; wait_queue_head_t offline_waitq ; }; struct cgroup_root { struct kernfs_root *kf_root ; unsigned int subsys_mask ; int hierarchy_id ; struct cgroup cgrp ; atomic_t nr_cgrps ; struct list_head root_list ; unsigned int flags ; struct idr cgroup_idr ; char release_agent_path[4096U] ; char name[64U] ; }; struct css_set { atomic_t refcount ; struct hlist_node hlist ; struct list_head tasks ; struct list_head mg_tasks ; struct list_head cgrp_links ; struct cgroup *dfl_cgrp ; struct cgroup_subsys_state *subsys[12U] ; struct list_head mg_preload_node ; struct list_head mg_node ; struct cgroup *mg_src_cgrp ; struct css_set *mg_dst_cset ; struct list_head e_cset_node[12U] ; struct callback_head callback_head ; }; struct cftype { char name[64U] ; int private ; umode_t mode ; size_t max_write_len ; unsigned int flags ; struct cgroup_subsys *ss ; struct list_head node ; struct kernfs_ops *kf_ops ; u64 (*read_u64)(struct cgroup_subsys_state * , struct cftype * ) ; s64 (*read_s64)(struct cgroup_subsys_state * , struct cftype * ) ; int (*seq_show)(struct seq_file * , void * ) ; void *(*seq_start)(struct seq_file * , loff_t * ) ; void *(*seq_next)(struct seq_file * , void * , loff_t * ) ; void (*seq_stop)(struct seq_file * , void * ) ; int (*write_u64)(struct cgroup_subsys_state * , struct cftype * , u64 ) ; int (*write_s64)(struct cgroup_subsys_state * , struct cftype * , s64 ) ; ssize_t (*write)(struct kernfs_open_file * , char * , size_t , loff_t ) ; struct lock_class_key lockdep_key ; }; struct cgroup_taskset; struct cgroup_subsys { struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state * ) ; int (*css_online)(struct cgroup_subsys_state * ) ; void (*css_offline)(struct cgroup_subsys_state * ) ; void (*css_free)(struct cgroup_subsys_state * ) ; int (*can_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*cancel_attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*attach)(struct cgroup_subsys_state * , struct cgroup_taskset * ) ; void (*fork)(struct task_struct * ) ; void (*exit)(struct cgroup_subsys_state * , struct cgroup_subsys_state * , struct task_struct * ) ; void (*bind)(struct cgroup_subsys_state * ) ; int disabled ; int early_init ; bool broken_hierarchy ; bool warned_broken_hierarchy ; int id ; char const *name ; struct cgroup_root *root ; struct idr css_idr ; struct list_head cfts ; struct cftype *base_cftypes ; }; struct netprio_map { struct callback_head rcu ; u32 priomap_len ; u32 priomap[] ; }; struct xfrm_policy; struct xfrm_state; struct request_sock; struct mnt_namespace; struct ipc_namespace; struct nsproxy { atomic_t count ; struct uts_namespace *uts_ns ; struct ipc_namespace *ipc_ns ; struct mnt_namespace *mnt_ns ; struct pid_namespace *pid_ns_for_children ; struct net *net_ns ; }; struct nlmsghdr { __u32 nlmsg_len ; __u16 nlmsg_type ; __u16 nlmsg_flags ; __u32 nlmsg_seq ; __u32 nlmsg_pid ; }; struct nlattr { __u16 nla_len ; __u16 nla_type ; }; struct netlink_callback { struct sk_buff *skb ; struct nlmsghdr const *nlh ; int (*dump)(struct sk_buff * , struct netlink_callback * ) ; int (*done)(struct netlink_callback * ) ; void *data ; struct module *module ; u16 family ; u16 min_dump_alloc ; unsigned int prev_seq ; unsigned int seq ; long args[6U] ; }; struct ndmsg { __u8 ndm_family ; __u8 ndm_pad1 ; __u16 ndm_pad2 ; __s32 ndm_ifindex ; __u16 ndm_state ; __u8 ndm_flags ; __u8 ndm_type ; }; struct rtnl_link_stats64 { __u64 rx_packets ; __u64 tx_packets ; __u64 rx_bytes ; __u64 tx_bytes ; __u64 rx_errors ; __u64 tx_errors ; __u64 rx_dropped ; __u64 tx_dropped ; __u64 multicast ; __u64 collisions ; __u64 rx_length_errors ; __u64 rx_over_errors ; __u64 rx_crc_errors ; __u64 rx_frame_errors ; __u64 rx_fifo_errors ; __u64 rx_missed_errors ; __u64 tx_aborted_errors ; __u64 tx_carrier_errors ; __u64 tx_fifo_errors ; __u64 tx_heartbeat_errors ; __u64 tx_window_errors ; __u64 rx_compressed ; __u64 tx_compressed ; }; struct ifla_vf_info { __u32 vf ; __u8 mac[32U] ; __u32 vlan ; __u32 qos ; __u32 spoofchk ; __u32 linkstate ; __u32 min_tx_rate ; __u32 max_tx_rate ; }; struct netpoll_info; struct phy_device; struct wireless_dev; enum netdev_tx { __NETDEV_TX_MIN = (-0x7FFFFFFF-1), NETDEV_TX_OK = 0, NETDEV_TX_BUSY = 16, NETDEV_TX_LOCKED = 32 } ; typedef enum netdev_tx netdev_tx_t; struct net_device_stats { unsigned long rx_packets ; unsigned long tx_packets ; unsigned long rx_bytes ; unsigned long tx_bytes ; unsigned long rx_errors ; unsigned long tx_errors ; unsigned long rx_dropped ; unsigned long tx_dropped ; unsigned long multicast ; unsigned long collisions ; unsigned long rx_length_errors ; unsigned long rx_over_errors ; unsigned long rx_crc_errors ; unsigned long rx_frame_errors ; unsigned long rx_fifo_errors ; unsigned long rx_missed_errors ; unsigned long tx_aborted_errors ; unsigned long tx_carrier_errors ; unsigned long tx_fifo_errors ; unsigned long tx_heartbeat_errors ; unsigned long tx_window_errors ; unsigned long rx_compressed ; unsigned long tx_compressed ; }; struct neigh_parms; struct netdev_hw_addr_list { struct list_head list ; int count ; }; struct hh_cache { u16 hh_len ; u16 __pad ; seqlock_t hh_lock ; unsigned long hh_data[16U] ; }; struct header_ops { int (*create)(struct sk_buff * , struct net_device * , unsigned short , void const * , void const * , unsigned int ) ; int (*parse)(struct sk_buff const * , unsigned char * ) ; int (*rebuild)(struct sk_buff * ) ; int (*cache)(struct neighbour const * , struct hh_cache * , __be16 ) ; void (*cache_update)(struct hh_cache * , struct net_device const * , unsigned char const * ) ; }; struct napi_struct { struct list_head poll_list ; unsigned long state ; int weight ; unsigned int gro_count ; int (*poll)(struct napi_struct * , int ) ; spinlock_t poll_lock ; int poll_owner ; struct net_device *dev ; struct sk_buff *gro_list ; struct sk_buff *skb ; struct list_head dev_list ; struct hlist_node napi_hash_node ; unsigned int napi_id ; }; enum rx_handler_result { RX_HANDLER_CONSUMED = 0, RX_HANDLER_ANOTHER = 1, RX_HANDLER_EXACT = 2, RX_HANDLER_PASS = 3 } ; typedef enum rx_handler_result rx_handler_result_t; typedef rx_handler_result_t rx_handler_func_t(struct sk_buff ** ); struct Qdisc; struct netdev_queue { struct net_device *dev ; struct Qdisc *qdisc ; struct Qdisc *qdisc_sleeping ; struct kobject kobj ; int numa_node ; spinlock_t _xmit_lock ; int xmit_lock_owner ; unsigned long trans_start ; unsigned long trans_timeout ; unsigned long state ; struct dql dql ; }; struct rps_map { unsigned int len ; struct callback_head rcu ; u16 cpus[0U] ; }; struct rps_dev_flow { u16 cpu ; u16 filter ; unsigned int last_qtail ; }; struct rps_dev_flow_table { unsigned int mask ; struct callback_head rcu ; struct rps_dev_flow flows[0U] ; }; struct netdev_rx_queue { struct rps_map *rps_map ; struct rps_dev_flow_table *rps_flow_table ; struct kobject kobj ; struct net_device *dev ; }; struct xps_map { unsigned int len ; unsigned int alloc_len ; struct callback_head rcu ; u16 queues[0U] ; }; struct xps_dev_maps { struct callback_head rcu ; struct xps_map *cpu_map[0U] ; }; struct netdev_tc_txq { u16 count ; u16 offset ; }; struct netdev_fcoe_hbainfo { char manufacturer[64U] ; char serial_number[64U] ; char hardware_version[64U] ; char driver_version[64U] ; char optionrom_version[64U] ; char firmware_version[64U] ; char model[256U] ; char model_description[256U] ; }; struct netdev_phys_port_id { unsigned char id[32U] ; unsigned char id_len ; }; struct net_device_ops { int (*ndo_init)(struct net_device * ) ; void (*ndo_uninit)(struct net_device * ) ; int (*ndo_open)(struct net_device * ) ; int (*ndo_stop)(struct net_device * ) ; netdev_tx_t (*ndo_start_xmit)(struct sk_buff * , struct net_device * ) ; u16 (*ndo_select_queue)(struct net_device * , struct sk_buff * , void * , u16 (*)(struct net_device * , struct sk_buff * ) ) ; void (*ndo_change_rx_flags)(struct net_device * , int ) ; void (*ndo_set_rx_mode)(struct net_device * ) ; int (*ndo_set_mac_address)(struct net_device * , void * ) ; int (*ndo_validate_addr)(struct net_device * ) ; int (*ndo_do_ioctl)(struct net_device * , struct ifreq * , int ) ; int (*ndo_set_config)(struct net_device * , struct ifmap * ) ; int (*ndo_change_mtu)(struct net_device * , int ) ; int (*ndo_neigh_setup)(struct net_device * , struct neigh_parms * ) ; void (*ndo_tx_timeout)(struct net_device * ) ; struct rtnl_link_stats64 *(*ndo_get_stats64)(struct net_device * , struct rtnl_link_stats64 * ) ; struct net_device_stats *(*ndo_get_stats)(struct net_device * ) ; int (*ndo_vlan_rx_add_vid)(struct net_device * , __be16 , u16 ) ; int (*ndo_vlan_rx_kill_vid)(struct net_device * , __be16 , u16 ) ; void (*ndo_poll_controller)(struct net_device * ) ; int (*ndo_netpoll_setup)(struct net_device * , struct netpoll_info * ) ; void (*ndo_netpoll_cleanup)(struct net_device * ) ; int (*ndo_busy_poll)(struct napi_struct * ) ; int (*ndo_set_vf_mac)(struct net_device * , int , u8 * ) ; int (*ndo_set_vf_vlan)(struct net_device * , int , u16 , u8 ) ; int (*ndo_set_vf_rate)(struct net_device * , int , int , int ) ; int (*ndo_set_vf_spoofchk)(struct net_device * , int , bool ) ; int (*ndo_get_vf_config)(struct net_device * , int , struct ifla_vf_info * ) ; int (*ndo_set_vf_link_state)(struct net_device * , int , int ) ; int (*ndo_set_vf_port)(struct net_device * , int , struct nlattr ** ) ; int (*ndo_get_vf_port)(struct net_device * , int , struct sk_buff * ) ; int (*ndo_setup_tc)(struct net_device * , u8 ) ; int (*ndo_fcoe_enable)(struct net_device * ) ; int (*ndo_fcoe_disable)(struct net_device * ) ; int (*ndo_fcoe_ddp_setup)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_ddp_done)(struct net_device * , u16 ) ; int (*ndo_fcoe_ddp_target)(struct net_device * , u16 , struct scatterlist * , unsigned int ) ; int (*ndo_fcoe_get_hbainfo)(struct net_device * , struct netdev_fcoe_hbainfo * ) ; int (*ndo_fcoe_get_wwn)(struct net_device * , u64 * , int ) ; int (*ndo_rx_flow_steer)(struct net_device * , struct sk_buff const * , u16 , u32 ) ; int (*ndo_add_slave)(struct net_device * , struct net_device * ) ; int (*ndo_del_slave)(struct net_device * , struct net_device * ) ; netdev_features_t (*ndo_fix_features)(struct net_device * , netdev_features_t ) ; int (*ndo_set_features)(struct net_device * , netdev_features_t ) ; int (*ndo_neigh_construct)(struct neighbour * ) ; void (*ndo_neigh_destroy)(struct neighbour * ) ; int (*ndo_fdb_add)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * , u16 ) ; int (*ndo_fdb_del)(struct ndmsg * , struct nlattr ** , struct net_device * , unsigned char const * ) ; int (*ndo_fdb_dump)(struct sk_buff * , struct netlink_callback * , struct net_device * , int ) ; int (*ndo_bridge_setlink)(struct net_device * , struct nlmsghdr * ) ; int (*ndo_bridge_getlink)(struct sk_buff * , u32 , u32 , struct net_device * , u32 ) ; int (*ndo_bridge_dellink)(struct net_device * , struct nlmsghdr * ) ; int (*ndo_change_carrier)(struct net_device * , bool ) ; int (*ndo_get_phys_port_id)(struct net_device * , struct netdev_phys_port_id * ) ; void (*ndo_add_vxlan_port)(struct net_device * , sa_family_t , __be16 ) ; void (*ndo_del_vxlan_port)(struct net_device * , sa_family_t , __be16 ) ; void *(*ndo_dfwd_add_station)(struct net_device * , struct net_device * ) ; void (*ndo_dfwd_del_station)(struct net_device * , void * ) ; netdev_tx_t (*ndo_dfwd_start_xmit)(struct sk_buff * , struct net_device * , void * ) ; int (*ndo_get_lock_subclass)(struct net_device * ) ; }; struct __anonstruct_adj_list_246 { struct list_head upper ; struct list_head lower ; }; struct __anonstruct_all_adj_list_247 { struct list_head upper ; struct list_head lower ; }; struct iw_handler_def; struct iw_public_data; struct forwarding_accel_ops; struct vlan_info; struct tipc_bearer; struct in_device; struct dn_dev; struct inet6_dev; struct cpu_rmap; struct pcpu_lstats; struct pcpu_sw_netstats; struct pcpu_dstats; struct pcpu_vstats; union __anonunion_ldv_40309_248 { void *ml_priv ; struct pcpu_lstats *lstats ; struct pcpu_sw_netstats *tstats ; struct pcpu_dstats *dstats ; struct pcpu_vstats *vstats ; }; struct garp_port; struct mrp_port; struct rtnl_link_ops; struct net_device { char name[16U] ; struct hlist_node name_hlist ; char *ifalias ; unsigned long mem_end ; unsigned long mem_start ; unsigned long base_addr ; int irq ; unsigned long state ; struct list_head dev_list ; struct list_head napi_list ; struct list_head unreg_list ; struct list_head close_list ; struct __anonstruct_adj_list_246 adj_list ; struct __anonstruct_all_adj_list_247 all_adj_list ; netdev_features_t features ; netdev_features_t hw_features ; netdev_features_t wanted_features ; netdev_features_t vlan_features ; netdev_features_t hw_enc_features ; netdev_features_t mpls_features ; int ifindex ; int iflink ; struct net_device_stats stats ; atomic_long_t rx_dropped ; atomic_long_t tx_dropped ; atomic_t carrier_changes ; struct iw_handler_def const *wireless_handlers ; struct iw_public_data *wireless_data ; struct net_device_ops const *netdev_ops ; struct ethtool_ops const *ethtool_ops ; struct forwarding_accel_ops const *fwd_ops ; struct header_ops const *header_ops ; unsigned int flags ; unsigned int priv_flags ; unsigned short gflags ; unsigned short padded ; unsigned char operstate ; unsigned char link_mode ; unsigned char if_port ; unsigned char dma ; unsigned int mtu ; unsigned short type ; unsigned short hard_header_len ; unsigned short needed_headroom ; unsigned short needed_tailroom ; unsigned char perm_addr[32U] ; unsigned char addr_assign_type ; unsigned char addr_len ; unsigned short neigh_priv_len ; unsigned short dev_id ; unsigned short dev_port ; spinlock_t addr_list_lock ; struct netdev_hw_addr_list uc ; struct netdev_hw_addr_list mc ; struct netdev_hw_addr_list dev_addrs ; struct kset *queues_kset ; bool uc_promisc ; unsigned int promiscuity ; unsigned int allmulti ; struct vlan_info *vlan_info ; struct dsa_switch_tree *dsa_ptr ; struct tipc_bearer *tipc_ptr ; void *atalk_ptr ; struct in_device *ip_ptr ; struct dn_dev *dn_ptr ; struct inet6_dev *ip6_ptr ; void *ax25_ptr ; struct wireless_dev *ieee80211_ptr ; unsigned long last_rx ; unsigned char *dev_addr ; struct netdev_rx_queue *_rx ; unsigned int num_rx_queues ; unsigned int real_num_rx_queues ; rx_handler_func_t *rx_handler ; void *rx_handler_data ; struct netdev_queue *ingress_queue ; unsigned char broadcast[32U] ; struct netdev_queue *_tx ; unsigned int num_tx_queues ; unsigned int real_num_tx_queues ; struct Qdisc *qdisc ; unsigned long tx_queue_len ; spinlock_t tx_global_lock ; struct xps_dev_maps *xps_maps ; struct cpu_rmap *rx_cpu_rmap ; unsigned long trans_start ; int watchdog_timeo ; struct timer_list watchdog_timer ; int *pcpu_refcnt ; struct list_head todo_list ; struct hlist_node index_hlist ; struct list_head link_watch_list ; unsigned char reg_state ; bool dismantle ; unsigned short rtnl_link_state ; void (*destructor)(struct net_device * ) ; struct netpoll_info *npinfo ; struct net *nd_net ; union __anonunion_ldv_40309_248 ldv_40309 ; struct garp_port *garp_port ; struct mrp_port *mrp_port ; struct device dev ; struct attribute_group const *sysfs_groups[4U] ; struct attribute_group const *sysfs_rx_queue_group ; struct rtnl_link_ops const *rtnl_link_ops ; unsigned int gso_max_size ; u16 gso_max_segs ; struct dcbnl_rtnl_ops const *dcbnl_ops ; u8 num_tc ; struct netdev_tc_txq tc_to_txq[16U] ; u8 prio_tc_map[16U] ; unsigned int fcoe_ddp_xid ; struct netprio_map *priomap ; struct phy_device *phydev ; struct lock_class_key *qdisc_tx_busylock ; int group ; struct pm_qos_request pm_qos_req ; }; struct packet_type { __be16 type ; struct net_device *dev ; int (*func)(struct sk_buff * , struct net_device * , struct packet_type * , struct net_device * ) ; bool (*id_match)(struct packet_type * , struct sock * ) ; void *af_packet_priv ; struct list_head list ; }; struct pcpu_sw_netstats { u64 rx_packets ; u64 rx_bytes ; u64 tx_packets ; u64 tx_bytes ; struct u64_stats_sync syncp ; }; struct poll_table_struct { void (*_qproc)(struct file * , wait_queue_head_t * , struct poll_table_struct * ) ; unsigned long _key ; }; struct res_counter { unsigned long long usage ; unsigned long long max_usage ; unsigned long long limit ; unsigned long long soft_limit ; unsigned long long failcnt ; spinlock_t lock ; struct res_counter *parent ; }; struct kioctx; typedef int kiocb_cancel_fn(struct kiocb * ); union __anonunion_ki_obj_251 { void *user ; struct task_struct *tsk ; }; struct eventfd_ctx; struct kiocb { struct file *ki_filp ; struct kioctx *ki_ctx ; kiocb_cancel_fn *ki_cancel ; void *private ; union __anonunion_ki_obj_251 ki_obj ; __u64 ki_user_data ; loff_t ki_pos ; size_t ki_nbytes ; struct list_head ki_list ; struct eventfd_ctx *ki_eventfd ; }; struct sock_filter { __u16 code ; __u8 jt ; __u8 jf ; __u32 k ; }; struct sock_filter_int { __u8 code ; unsigned char dst_reg : 4 ; unsigned char src_reg : 4 ; __s16 off ; __s32 imm ; }; struct sock_fprog_kern { u16 len ; struct sock_filter *filter ; }; union __anonunion_ldv_42910_252 { struct sock_filter insns[0U] ; struct sock_filter_int insnsi[0U] ; struct work_struct work ; }; struct sk_filter { atomic_t refcnt ; unsigned char jited : 1 ; unsigned int len : 31 ; struct sock_fprog_kern *orig_prog ; struct callback_head rcu ; unsigned int (*bpf_func)(struct sk_buff const * , struct sock_filter_int const * ) ; union __anonunion_ldv_42910_252 ldv_42910 ; }; struct nla_policy { u16 type ; u16 len ; }; struct rtnl_link_ops { struct list_head list ; char const *kind ; size_t priv_size ; void (*setup)(struct net_device * ) ; int maxtype ; struct nla_policy const *policy ; int (*validate)(struct nlattr ** , struct nlattr ** ) ; int (*newlink)(struct net * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; int (*changelink)(struct net_device * , struct nlattr ** , struct nlattr ** ) ; void (*dellink)(struct net_device * , struct list_head * ) ; size_t (*get_size)(struct net_device const * ) ; int (*fill_info)(struct sk_buff * , struct net_device const * ) ; size_t (*get_xstats_size)(struct net_device const * ) ; int (*fill_xstats)(struct sk_buff * , struct net_device const * ) ; unsigned int (*get_num_tx_queues)(void) ; unsigned int (*get_num_rx_queues)(void) ; int slave_maxtype ; struct nla_policy const *slave_policy ; int (*slave_validate)(struct nlattr ** , struct nlattr ** ) ; int (*slave_changelink)(struct net_device * , struct net_device * , struct nlattr ** , struct nlattr ** ) ; size_t (*get_slave_size)(struct net_device const * , struct net_device const * ) ; int (*fill_slave_info)(struct sk_buff * , struct net_device const * , struct net_device const * ) ; }; struct neigh_table; struct neigh_parms { struct net *net ; struct net_device *dev ; struct neigh_parms *next ; int (*neigh_setup)(struct neighbour * ) ; void (*neigh_cleanup)(struct neighbour * ) ; struct neigh_table *tbl ; void *sysctl_table ; int dead ; atomic_t refcnt ; struct callback_head callback_head ; int reachable_time ; int data[12U] ; unsigned long data_state[1U] ; }; struct neigh_statistics { unsigned long allocs ; unsigned long destroys ; unsigned long hash_grows ; unsigned long res_failed ; unsigned long lookups ; unsigned long hits ; unsigned long rcv_probes_mcast ; unsigned long rcv_probes_ucast ; unsigned long periodic_gc_runs ; unsigned long forced_gc_runs ; unsigned long unres_discards ; }; struct neigh_ops; struct neighbour { struct neighbour *next ; struct neigh_table *tbl ; struct neigh_parms *parms ; unsigned long confirmed ; unsigned long updated ; rwlock_t lock ; atomic_t refcnt ; struct sk_buff_head arp_queue ; unsigned int arp_queue_len_bytes ; struct timer_list timer ; unsigned long used ; atomic_t probes ; __u8 flags ; __u8 nud_state ; __u8 type ; __u8 dead ; seqlock_t ha_lock ; unsigned char ha[32U] ; struct hh_cache hh ; int (*output)(struct neighbour * , struct sk_buff * ) ; struct neigh_ops const *ops ; struct callback_head rcu ; struct net_device *dev ; u8 primary_key[0U] ; }; struct neigh_ops { int family ; void (*solicit)(struct neighbour * , struct sk_buff * ) ; void (*error_report)(struct neighbour * , struct sk_buff * ) ; int (*output)(struct neighbour * , struct sk_buff * ) ; int (*connected_output)(struct neighbour * , struct sk_buff * ) ; }; struct pneigh_entry { struct pneigh_entry *next ; struct net *net ; struct net_device *dev ; u8 flags ; u8 key[0U] ; }; struct neigh_hash_table { struct neighbour **hash_buckets ; unsigned int hash_shift ; __u32 hash_rnd[4U] ; struct callback_head rcu ; }; struct neigh_table { struct neigh_table *next ; int family ; int entry_size ; int key_len ; __u32 (*hash)(void const * , struct net_device const * , __u32 * ) ; int (*constructor)(struct neighbour * ) ; int (*pconstructor)(struct pneigh_entry * ) ; void (*pdestructor)(struct pneigh_entry * ) ; void (*proxy_redo)(struct sk_buff * ) ; char *id ; struct neigh_parms parms ; int gc_interval ; int gc_thresh1 ; int gc_thresh2 ; int gc_thresh3 ; unsigned long last_flush ; struct delayed_work gc_work ; struct timer_list proxy_timer ; struct sk_buff_head proxy_queue ; atomic_t entries ; rwlock_t lock ; unsigned long last_rand ; struct neigh_statistics *stats ; struct neigh_hash_table *nht ; struct pneigh_entry **phash_buckets ; }; struct dn_route; union __anonunion_ldv_44308_256 { struct dst_entry *next ; struct rtable *rt_next ; struct rt6_info *rt6_next ; struct dn_route *dn_next ; }; struct dst_entry { struct callback_head callback_head ; struct dst_entry *child ; struct net_device *dev ; struct dst_ops *ops ; unsigned long _metrics ; unsigned long expires ; struct dst_entry *path ; struct dst_entry *from ; struct xfrm_state *xfrm ; int (*input)(struct sk_buff * ) ; int (*output)(struct sock * , struct sk_buff * ) ; unsigned short flags ; unsigned short pending_confirm ; short error ; short obsolete ; unsigned short header_len ; unsigned short trailer_len ; __u32 tclassid ; long __pad_to_align_refcnt[2U] ; atomic_t __refcnt ; int __use ; unsigned long lastuse ; union __anonunion_ldv_44308_256 ldv_44308 ; }; struct __anonstruct_socket_lock_t_257 { spinlock_t slock ; int owned ; wait_queue_head_t wq ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_socket_lock_t_257 socket_lock_t; struct proto; typedef __u32 __portpair; typedef __u64 __addrpair; struct __anonstruct_ldv_44543_259 { __be32 skc_daddr ; __be32 skc_rcv_saddr ; }; union __anonunion_ldv_44544_258 { __addrpair skc_addrpair ; struct __anonstruct_ldv_44543_259 ldv_44543 ; }; union __anonunion_ldv_44548_260 { unsigned int skc_hash ; __u16 skc_u16hashes[2U] ; }; struct __anonstruct_ldv_44554_262 { __be16 skc_dport ; __u16 skc_num ; }; union __anonunion_ldv_44555_261 { __portpair skc_portpair ; struct __anonstruct_ldv_44554_262 ldv_44554 ; }; union __anonunion_ldv_44564_263 { struct hlist_node skc_bind_node ; struct hlist_nulls_node skc_portaddr_node ; }; union __anonunion_ldv_44573_264 { struct hlist_node skc_node ; struct hlist_nulls_node skc_nulls_node ; }; struct sock_common { union __anonunion_ldv_44544_258 ldv_44544 ; union __anonunion_ldv_44548_260 ldv_44548 ; union __anonunion_ldv_44555_261 ldv_44555 ; unsigned short skc_family ; unsigned char volatile skc_state ; unsigned char skc_reuse : 4 ; unsigned char skc_reuseport : 4 ; int skc_bound_dev_if ; union __anonunion_ldv_44564_263 ldv_44564 ; struct proto *skc_prot ; struct net *skc_net ; struct in6_addr skc_v6_daddr ; struct in6_addr skc_v6_rcv_saddr ; int skc_dontcopy_begin[0U] ; union __anonunion_ldv_44573_264 ldv_44573 ; int skc_tx_queue_mapping ; atomic_t skc_refcnt ; int skc_dontcopy_end[0U] ; }; struct cg_proto; struct __anonstruct_sk_backlog_265 { atomic_t rmem_alloc ; int len ; struct sk_buff *head ; struct sk_buff *tail ; }; struct sock { struct sock_common __sk_common ; socket_lock_t sk_lock ; struct sk_buff_head sk_receive_queue ; struct __anonstruct_sk_backlog_265 sk_backlog ; int sk_forward_alloc ; __u32 sk_rxhash ; unsigned int sk_napi_id ; unsigned int sk_ll_usec ; atomic_t sk_drops ; int sk_rcvbuf ; struct sk_filter *sk_filter ; struct socket_wq *sk_wq ; struct xfrm_policy *sk_policy[2U] ; unsigned long sk_flags ; struct dst_entry *sk_rx_dst ; struct dst_entry *sk_dst_cache ; spinlock_t sk_dst_lock ; atomic_t sk_wmem_alloc ; atomic_t sk_omem_alloc ; int sk_sndbuf ; struct sk_buff_head sk_write_queue ; unsigned char sk_shutdown : 2 ; unsigned char sk_no_check_tx : 1 ; unsigned char sk_no_check_rx : 1 ; unsigned char sk_userlocks : 4 ; unsigned char sk_protocol ; unsigned short sk_type ; int sk_wmem_queued ; gfp_t sk_allocation ; u32 sk_pacing_rate ; u32 sk_max_pacing_rate ; netdev_features_t sk_route_caps ; netdev_features_t sk_route_nocaps ; int sk_gso_type ; unsigned int sk_gso_max_size ; u16 sk_gso_max_segs ; int sk_rcvlowat ; unsigned long sk_lingertime ; struct sk_buff_head sk_error_queue ; struct proto *sk_prot_creator ; rwlock_t sk_callback_lock ; int sk_err ; int sk_err_soft ; unsigned short sk_ack_backlog ; unsigned short sk_max_ack_backlog ; __u32 sk_priority ; __u32 sk_cgrp_prioidx ; struct pid *sk_peer_pid ; struct cred const *sk_peer_cred ; long sk_rcvtimeo ; long sk_sndtimeo ; void *sk_protinfo ; struct timer_list sk_timer ; ktime_t sk_stamp ; struct socket *sk_socket ; void *sk_user_data ; struct page_frag sk_frag ; struct sk_buff *sk_send_head ; __s32 sk_peek_off ; int sk_write_pending ; void *sk_security ; __u32 sk_mark ; u32 sk_classid ; struct cg_proto *sk_cgrp ; void (*sk_state_change)(struct sock * ) ; void (*sk_data_ready)(struct sock * ) ; void (*sk_write_space)(struct sock * ) ; void (*sk_error_report)(struct sock * ) ; int (*sk_backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*sk_destruct)(struct sock * ) ; }; struct request_sock_ops; struct timewait_sock_ops; struct inet_hashinfo; struct raw_hashinfo; struct udp_table; union __anonunion_h_266 { struct inet_hashinfo *hashinfo ; struct udp_table *udp_table ; struct raw_hashinfo *raw_hash ; }; struct proto { void (*close)(struct sock * , long ) ; int (*connect)(struct sock * , struct sockaddr * , int ) ; int (*disconnect)(struct sock * , int ) ; struct sock *(*accept)(struct sock * , int , int * ) ; int (*ioctl)(struct sock * , int , unsigned long ) ; int (*init)(struct sock * ) ; void (*destroy)(struct sock * ) ; void (*shutdown)(struct sock * , int ) ; int (*setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_setsockopt)(struct sock * , int , int , char * , unsigned int ) ; int (*compat_getsockopt)(struct sock * , int , int , char * , int * ) ; int (*compat_ioctl)(struct sock * , unsigned int , unsigned long ) ; int (*sendmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t ) ; int (*recvmsg)(struct kiocb * , struct sock * , struct msghdr * , size_t , int , int , int * ) ; int (*sendpage)(struct sock * , struct page * , int , size_t , int ) ; int (*bind)(struct sock * , struct sockaddr * , int ) ; int (*backlog_rcv)(struct sock * , struct sk_buff * ) ; void (*release_cb)(struct sock * ) ; void (*mtu_reduced)(struct sock * ) ; void (*hash)(struct sock * ) ; void (*unhash)(struct sock * ) ; void (*rehash)(struct sock * ) ; int (*get_port)(struct sock * , unsigned short ) ; void (*clear_sk)(struct sock * , int ) ; unsigned int inuse_idx ; bool (*stream_memory_free)(struct sock const * ) ; void (*enter_memory_pressure)(struct sock * ) ; atomic_long_t *memory_allocated ; struct percpu_counter *sockets_allocated ; int *memory_pressure ; long *sysctl_mem ; int *sysctl_wmem ; int *sysctl_rmem ; int max_header ; bool no_autobind ; struct kmem_cache *slab ; unsigned int obj_size ; int slab_flags ; struct percpu_counter *orphan_count ; struct request_sock_ops *rsk_prot ; struct timewait_sock_ops *twsk_prot ; union __anonunion_h_266 h ; struct module *owner ; char name[32U] ; struct list_head node ; int (*init_cgroup)(struct mem_cgroup * , struct cgroup_subsys * ) ; void (*destroy_cgroup)(struct mem_cgroup * ) ; struct cg_proto *(*proto_cgroup)(struct mem_cgroup * ) ; }; struct cg_proto { struct res_counter memory_allocated ; struct percpu_counter sockets_allocated ; int memory_pressure ; long sysctl_mem[3U] ; unsigned long flags ; struct mem_cgroup *memcg ; }; struct ipv6_devconf { __s32 forwarding ; __s32 hop_limit ; __s32 mtu6 ; __s32 accept_ra ; __s32 accept_redirects ; __s32 autoconf ; __s32 dad_transmits ; __s32 rtr_solicits ; __s32 rtr_solicit_interval ; __s32 rtr_solicit_delay ; __s32 force_mld_version ; __s32 mldv1_unsolicited_report_interval ; __s32 mldv2_unsolicited_report_interval ; __s32 use_tempaddr ; __s32 temp_valid_lft ; __s32 temp_prefered_lft ; __s32 regen_max_retry ; __s32 max_desync_factor ; __s32 max_addresses ; __s32 accept_ra_defrtr ; __s32 accept_ra_pinfo ; __s32 accept_ra_rtr_pref ; __s32 rtr_probe_interval ; __s32 accept_ra_rt_info_max_plen ; __s32 proxy_ndp ; __s32 accept_source_route ; __s32 optimistic_dad ; __s32 mc_forwarding ; __s32 disable_ipv6 ; __s32 accept_dad ; __s32 force_tllao ; __s32 ndisc_notify ; __s32 suppress_frag_ndisc ; void *sysctl ; }; struct request_sock_ops { int family ; int obj_size ; struct kmem_cache *slab ; char *slab_name ; int (*rtx_syn_ack)(struct sock * , struct request_sock * ) ; void (*send_ack)(struct sock * , struct sk_buff * , struct request_sock * ) ; void (*send_reset)(struct sock * , struct sk_buff * ) ; void (*destructor)(struct request_sock * ) ; void (*syn_ack_timeout)(struct sock * , struct request_sock * ) ; }; struct request_sock { struct sock_common __req_common ; struct request_sock *dl_next ; u16 mss ; u8 num_retrans ; unsigned char cookie_ts : 1 ; unsigned char num_timeout : 7 ; u32 window_clamp ; u32 rcv_wnd ; u32 ts_recent ; unsigned long expires ; struct request_sock_ops const *rsk_ops ; struct sock *sk ; u32 secid ; u32 peer_secid ; }; struct timewait_sock_ops { struct kmem_cache *twsk_slab ; char *twsk_slab_name ; unsigned int twsk_obj_size ; int (*twsk_unique)(struct sock * , struct sock * , void * ) ; void (*twsk_destructor)(struct sock * ) ; }; struct ip6_sf_list { struct ip6_sf_list *sf_next ; struct in6_addr sf_addr ; unsigned long sf_count[2U] ; unsigned char sf_gsresp ; unsigned char sf_oldin ; unsigned char sf_crcount ; }; struct ifmcaddr6 { struct in6_addr mca_addr ; struct inet6_dev *idev ; struct ifmcaddr6 *next ; struct ip6_sf_list *mca_sources ; struct ip6_sf_list *mca_tomb ; unsigned int mca_sfmode ; unsigned char mca_crcount ; unsigned long mca_sfcount[2U] ; struct timer_list mca_timer ; unsigned int mca_flags ; int mca_users ; atomic_t mca_refcnt ; spinlock_t mca_lock ; unsigned long mca_cstamp ; unsigned long mca_tstamp ; }; struct ifacaddr6 { struct in6_addr aca_addr ; struct inet6_dev *aca_idev ; struct rt6_info *aca_rt ; struct ifacaddr6 *aca_next ; int aca_users ; atomic_t aca_refcnt ; spinlock_t aca_lock ; unsigned long aca_cstamp ; unsigned long aca_tstamp ; }; struct ipv6_devstat { struct proc_dir_entry *proc_dir_entry ; struct ipstats_mib *ipv6 ; struct icmpv6_mib_device *icmpv6dev ; struct icmpv6msg_mib_device *icmpv6msgdev ; }; struct inet6_dev { struct net_device *dev ; struct list_head addr_list ; struct ifmcaddr6 *mc_list ; struct ifmcaddr6 *mc_tomb ; spinlock_t mc_lock ; unsigned char mc_qrv ; unsigned char mc_gq_running ; unsigned char mc_ifc_count ; unsigned char mc_dad_count ; unsigned long mc_v1_seen ; unsigned long mc_qi ; unsigned long mc_qri ; unsigned long mc_maxdelay ; struct timer_list mc_gq_timer ; struct timer_list mc_ifc_timer ; struct timer_list mc_dad_timer ; struct ifacaddr6 *ac_list ; rwlock_t lock ; atomic_t refcnt ; __u32 if_flags ; int dead ; u8 rndid[8U] ; struct timer_list regen_timer ; struct list_head tempaddr_list ; struct in6_addr token ; struct neigh_parms *nd_parms ; struct ipv6_devconf cnf ; struct ipv6_devstat stats ; struct timer_list rs_timer ; __u8 rs_probes ; unsigned long tstamp ; struct callback_head rcu ; }; struct batadv_bla_claim_dst { uint8_t magic[3U] ; uint8_t type ; __be16 group ; }; struct batadv_ogm_packet { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t flags ; __be32 seqno ; uint8_t orig[6U] ; uint8_t prev_sender[6U] ; uint8_t reserved ; uint8_t tq ; __be16 tvlv_len ; }; struct batadv_hard_iface_bat_iv { unsigned char *ogm_buff ; int ogm_buff_len ; atomic_t ogm_seqno ; }; struct batadv_hard_iface { struct list_head list ; int16_t if_num ; char if_status ; struct net_device *net_dev ; uint8_t num_bcasts ; struct kobject *hardif_obj ; atomic_t refcount ; struct packet_type batman_adv_ptype ; struct net_device *soft_iface ; struct callback_head rcu ; struct batadv_hard_iface_bat_iv bat_iv ; struct work_struct cleanup_work ; struct dentry *debug_dir ; }; struct batadv_orig_ifinfo { struct hlist_node list ; struct batadv_hard_iface *if_outgoing ; struct batadv_neigh_node *router ; uint32_t last_real_seqno ; uint8_t last_ttl ; unsigned long batman_seqno_reset ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_frag_table_entry { struct hlist_head head ; spinlock_t lock ; unsigned long timestamp ; uint16_t seqno ; uint16_t size ; }; struct batadv_orig_bat_iv { unsigned long *bcast_own ; uint8_t *bcast_own_sum ; spinlock_t ogm_cnt_lock ; }; struct batadv_priv; struct batadv_orig_node { uint8_t orig[6U] ; uint8_t primary_addr[6U] ; struct hlist_head ifinfo_list ; struct batadv_orig_ifinfo *last_bonding_candidate ; uint16_t dat_addr ; unsigned long last_seen ; unsigned long bcast_seqno_reset ; uint8_t mcast_flags ; struct hlist_node mcast_want_all_unsnoopables_node ; struct hlist_node mcast_want_all_ipv4_node ; struct hlist_node mcast_want_all_ipv6_node ; uint8_t capabilities ; uint8_t capa_initialized ; atomic_t last_ttvn ; unsigned char *tt_buff ; int16_t tt_buff_len ; spinlock_t tt_buff_lock ; spinlock_t tt_lock ; unsigned long bcast_bits[1U] ; uint32_t last_bcast_seqno ; struct hlist_head neigh_list ; spinlock_t neigh_list_lock ; struct hlist_node hash_entry ; struct batadv_priv *bat_priv ; spinlock_t bcast_seqno_lock ; atomic_t refcount ; struct callback_head rcu ; struct list_head in_coding_list ; struct list_head out_coding_list ; spinlock_t in_coding_list_lock ; spinlock_t out_coding_list_lock ; struct batadv_frag_table_entry fragments[8U] ; struct list_head vlan_list ; spinlock_t vlan_list_lock ; struct batadv_orig_bat_iv bat_iv ; }; struct batadv_gw_node { struct hlist_node list ; struct batadv_orig_node *orig_node ; uint32_t bandwidth_down ; uint32_t bandwidth_up ; unsigned long deleted ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_neigh_node { struct hlist_node list ; struct batadv_orig_node *orig_node ; uint8_t addr[6U] ; struct hlist_head ifinfo_list ; spinlock_t ifinfo_lock ; struct batadv_hard_iface *if_incoming ; unsigned long last_seen ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_neigh_ifinfo_bat_iv { uint8_t tq_recv[5U] ; uint8_t tq_index ; uint8_t tq_avg ; unsigned long real_bits[1U] ; uint8_t real_packet_count ; }; struct batadv_neigh_ifinfo { struct hlist_node list ; struct batadv_hard_iface *if_outgoing ; struct batadv_neigh_ifinfo_bat_iv bat_iv ; uint8_t last_ttl ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_bcast_duplist_entry { uint8_t orig[6U] ; __be32 crc ; unsigned long entrytime ; }; struct batadv_hashtable; struct batadv_priv_tt { atomic_t vn ; atomic_t ogm_append_cnt ; atomic_t local_changes ; struct list_head changes_list ; struct batadv_hashtable *local_hash ; struct batadv_hashtable *global_hash ; struct list_head req_list ; struct list_head roam_list ; spinlock_t changes_list_lock ; spinlock_t req_list_lock ; spinlock_t roam_list_lock ; unsigned char *last_changeset ; int16_t last_changeset_len ; spinlock_t last_changeset_lock ; spinlock_t commit_lock ; struct delayed_work work ; }; struct batadv_priv_bla { atomic_t num_requests ; struct batadv_hashtable *claim_hash ; struct batadv_hashtable *backbone_hash ; struct batadv_bcast_duplist_entry bcast_duplist[16U] ; int bcast_duplist_curr ; spinlock_t bcast_duplist_lock ; struct batadv_bla_claim_dst claim_dest ; struct delayed_work work ; }; struct batadv_priv_debug_log { char log_buff[8192U] ; unsigned long log_start ; unsigned long log_end ; spinlock_t lock ; wait_queue_head_t queue_wait ; }; struct batadv_priv_gw { struct hlist_head list ; spinlock_t list_lock ; struct batadv_gw_node *curr_gw ; atomic_t bandwidth_down ; atomic_t bandwidth_up ; atomic_t reselect ; }; struct batadv_priv_tvlv { struct hlist_head container_list ; struct hlist_head handler_list ; spinlock_t container_list_lock ; spinlock_t handler_list_lock ; }; struct batadv_priv_dat { uint16_t addr ; struct batadv_hashtable *hash ; struct delayed_work work ; }; struct batadv_priv_mcast { struct hlist_head mla_list ; struct hlist_head want_all_unsnoopables_list ; struct hlist_head want_all_ipv4_list ; struct hlist_head want_all_ipv6_list ; uint8_t flags ; bool enabled ; atomic_t num_disabled ; atomic_t num_want_all_unsnoopables ; atomic_t num_want_all_ipv4 ; atomic_t num_want_all_ipv6 ; spinlock_t want_lists_lock ; }; struct batadv_priv_nc { struct delayed_work work ; struct dentry *debug_dir ; u8 min_tq ; u32 max_fwd_delay ; u32 max_buffer_time ; unsigned long timestamp_fwd_flush ; unsigned long timestamp_sniffed_purge ; struct batadv_hashtable *coding_hash ; struct batadv_hashtable *decoding_hash ; }; struct batadv_algo_ops; struct batadv_priv { atomic_t mesh_state ; struct net_device *soft_iface ; struct net_device_stats stats ; uint64_t *bat_counters ; atomic_t aggregated_ogms ; atomic_t bonding ; atomic_t fragmentation ; atomic_t packet_size_max ; atomic_t frag_seqno ; atomic_t bridge_loop_avoidance ; atomic_t distributed_arp_table ; atomic_t multicast_mode ; atomic_t gw_mode ; atomic_t gw_sel_class ; atomic_t orig_interval ; atomic_t hop_penalty ; atomic_t log_level ; uint32_t isolation_mark ; uint32_t isolation_mark_mask ; atomic_t bcast_seqno ; atomic_t bcast_queue_left ; atomic_t batman_queue_left ; char num_ifaces ; struct kobject *mesh_obj ; struct dentry *debug_dir ; struct hlist_head forw_bat_list ; struct hlist_head forw_bcast_list ; struct batadv_hashtable *orig_hash ; spinlock_t forw_bat_list_lock ; spinlock_t forw_bcast_list_lock ; struct delayed_work orig_work ; struct work_struct cleanup_work ; struct batadv_hard_iface *primary_if ; struct batadv_algo_ops *bat_algo_ops ; struct hlist_head softif_vlan_list ; spinlock_t softif_vlan_list_lock ; struct batadv_priv_bla bla ; struct batadv_priv_debug_log *debug_log ; struct batadv_priv_gw gw ; struct batadv_priv_tt tt ; struct batadv_priv_tvlv tvlv ; struct batadv_priv_dat dat ; struct batadv_priv_mcast mcast ; atomic_t network_coding ; struct batadv_priv_nc nc ; }; struct batadv_forw_packet { struct hlist_node list ; unsigned long send_time ; uint8_t own ; struct sk_buff *skb ; uint16_t packet_len ; uint32_t direct_link_flags ; uint8_t num_packets ; struct delayed_work delayed_work ; struct batadv_hard_iface *if_incoming ; struct batadv_hard_iface *if_outgoing ; }; struct batadv_algo_ops { struct hlist_node list ; char *name ; int (*bat_iface_enable)(struct batadv_hard_iface * ) ; void (*bat_iface_disable)(struct batadv_hard_iface * ) ; void (*bat_iface_update_mac)(struct batadv_hard_iface * ) ; void (*bat_primary_iface_set)(struct batadv_hard_iface * ) ; void (*bat_ogm_schedule)(struct batadv_hard_iface * ) ; void (*bat_ogm_emit)(struct batadv_forw_packet * ) ; int (*bat_neigh_cmp)(struct batadv_neigh_node * , struct batadv_hard_iface * , struct batadv_neigh_node * , struct batadv_hard_iface * ) ; bool (*bat_neigh_is_equiv_or_better)(struct batadv_neigh_node * , struct batadv_hard_iface * , struct batadv_neigh_node * , struct batadv_hard_iface * ) ; void (*bat_orig_print)(struct batadv_priv * , struct seq_file * , struct batadv_hard_iface * ) ; void (*bat_orig_free)(struct batadv_orig_node * ) ; int (*bat_orig_add_if)(struct batadv_orig_node * , int ) ; int (*bat_orig_del_if)(struct batadv_orig_node * , int , int ) ; }; typedef uint64_t pao_T_____41; typedef uint64_t pao_T_____42; typedef uint64_t pao_T_____43; typedef uint64_t pao_T_____44; struct batadv_hashtable { struct hlist_head *table ; spinlock_t *list_locks ; uint32_t size ; }; enum batadv_dup_status { BATADV_NO_DUP = 0, BATADV_ORIG_DUP = 1, BATADV_NEIGH_DUP = 2, BATADV_PROTECTED = 3 } ; enum hrtimer_restart; enum hrtimer_restart; struct skb_frag_struct; typedef struct skb_frag_struct skb_frag_t; struct __anonstruct_page_225 { struct page *p ; }; struct skb_frag_struct { struct __anonstruct_page_225 page ; __u32 page_offset ; __u32 size ; }; struct skb_shared_hwtstamps { ktime_t hwtstamp ; ktime_t syststamp ; }; struct skb_shared_info { unsigned char nr_frags ; __u8 tx_flags ; unsigned short gso_size ; unsigned short gso_segs ; unsigned short gso_type ; struct sk_buff *frag_list ; struct skb_shared_hwtstamps hwtstamps ; __be32 ip6_frag_id ; atomic_t dataref ; void *destructor_arg ; skb_frag_t frags[17U] ; }; enum skb_free_reason { SKB_REASON_CONSUMED = 0, SKB_REASON_DROPPED = 1 } ; struct arphdr { __be16 ar_hrd ; __be16 ar_pro ; unsigned char ar_hln ; unsigned char ar_pln ; __be16 ar_op ; }; struct vlan_ethhdr { unsigned char h_dest[6U] ; unsigned char h_source[6U] ; __be16 h_vlan_proto ; __be16 h_vlan_TCI ; __be16 h_vlan_encapsulated_proto ; }; struct batadv_bcast_packet { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t reserved ; __be32 seqno ; uint8_t orig[6U] ; }; struct batadv_bla_backbone_gw { uint8_t orig[6U] ; unsigned short vid ; struct hlist_node hash_entry ; struct batadv_priv *bat_priv ; unsigned long lasttime ; atomic_t wait_periods ; atomic_t request_sent ; uint16_t crc ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_bla_claim { uint8_t addr[6U] ; unsigned short vid ; struct batadv_bla_backbone_gw *backbone_gw ; unsigned long lasttime ; struct hlist_node hash_entry ; struct callback_head rcu ; atomic_t refcount ; }; struct __va_list_tag; typedef struct __va_list_tag __va_list_tag; typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; struct compat_timespec; struct __anonstruct_futex_17 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_18 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_19 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion_ldv_2850_16 { struct __anonstruct_futex_17 futex ; struct __anonstruct_nanosleep_18 nanosleep ; struct __anonstruct_poll_19 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion_ldv_2850_16 ldv_2850 ; }; struct exec_domain; struct map_segment; struct exec_domain { char const *name ; void (*handler)(int , struct pt_regs * ) ; unsigned char pers_low ; unsigned char pers_high ; unsigned long *signal_map ; unsigned long *signal_invmap ; struct map_segment *err_map ; struct map_segment *socktype_map ; struct map_segment *sockopt_map ; struct map_segment *af_map ; struct module *module ; struct exec_domain *next ; }; struct __anonstruct_mm_segment_t_29 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_29 mm_segment_t; struct thread_info { struct task_struct *task ; struct exec_domain *exec_domain ; __u32 flags ; __u32 status ; __u32 cpu ; int saved_preempt_count ; mm_segment_t addr_limit ; struct restart_block restart_block ; void *sysenter_return ; unsigned char sig_on_uaccess_error : 1 ; unsigned char uaccess_err : 1 ; }; struct __wait_queue; typedef struct __wait_queue wait_queue_t; struct __wait_queue { unsigned int flags ; void *private ; int (*func)(wait_queue_t * , unsigned int , int , void * ) ; struct list_head task_list ; }; enum hrtimer_restart; typedef s32 compat_time_t; struct compat_timespec { compat_time_t tv_sec ; s32 tv_nsec ; }; struct __large_struct { unsigned long buf[100U] ; }; struct pollfd { int fd ; short events ; short revents ; }; typedef struct poll_table_struct poll_table; struct batadv_debuginfo { struct attribute attr ; struct file_operations const fops ; }; enum hrtimer_restart; struct batadv_unicast_packet { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t ttvn ; uint8_t dest[6U] ; }; struct batadv_unicast_4addr_packet { struct batadv_unicast_packet u ; uint8_t src[6U] ; uint8_t subtype ; uint8_t reserved ; }; struct batadv_dat_entry { __be32 ip ; uint8_t mac_addr[6U] ; unsigned short vid ; unsigned long last_update ; struct hlist_node hash_entry ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_dat_candidate { int type ; struct batadv_orig_node *orig_node ; }; enum hrtimer_restart; struct batadv_frag_packet { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; unsigned char reserved : 4 ; unsigned char no : 4 ; uint8_t dest[6U] ; uint8_t orig[6U] ; __be16 seqno ; __be16 total_size ; }; struct batadv_frag_list_entry { struct hlist_node list ; struct sk_buff *skb ; uint8_t no ; }; typedef __u16 __sum16; enum hrtimer_restart; enum batadv_uev_action { BATADV_UEV_ADD = 0, BATADV_UEV_DEL = 1, BATADV_UEV_CHANGE = 2 } ; enum batadv_uev_type { BATADV_UEV_GW = 0 } ; struct ipv6hdr { unsigned char priority : 4 ; unsigned char version : 4 ; __u8 flow_lbl[3U] ; __be16 payload_len ; __u8 nexthdr ; __u8 hop_limit ; struct in6_addr saddr ; struct in6_addr daddr ; }; struct udphdr { __be16 source ; __be16 dest ; __be16 len ; __sum16 check ; }; struct iphdr { unsigned char ihl : 4 ; unsigned char version : 4 ; __u8 tos ; __be16 tot_len ; __be16 id ; __be16 frag_off ; __u8 ttl ; __u8 protocol ; __sum16 check ; __be32 saddr ; __be32 daddr ; }; struct batadv_tvlv_gateway_data { __be32 bandwidth_down ; __be32 bandwidth_up ; }; enum batadv_dhcp_recipient { BATADV_DHCP_NO = 0, BATADV_DHCP_TO_SERVER = 1, BATADV_DHCP_TO_CLIENT = 2 } ; enum hrtimer_restart; enum batadv_bandwidth_units { BATADV_BW_UNIT_KBIT = 0, BATADV_BW_UNIT_MBIT = 1 } ; enum hrtimer_restart; struct netdev_notifier_info { struct net_device *dev ; }; typedef int pao_T_____33; typedef int pao_T_____34; typedef int pao_T_____35; typedef int pao_T_____36; typedef int pao_T_____37; typedef int pao_T_____38; typedef int pao_T_____39; typedef int pao_T_____40; enum batadv_hard_if_cleanup { BATADV_IF_CLEANUP_KEEP = 0, BATADV_IF_CLEANUP_AUTO = 1 } ; enum hrtimer_restart; enum hrtimer_restart; struct batadv_icmp_header { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t msg_type ; uint8_t dst[6U] ; uint8_t orig[6U] ; uint8_t uid ; uint8_t align[3U] ; }; struct batadv_icmp_packet_rr { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t msg_type ; uint8_t dst[6U] ; uint8_t orig[6U] ; uint8_t uid ; uint8_t rr_cur ; __be16 seqno ; uint8_t rr[16U][6U] ; }; struct batadv_socket_client { struct list_head queue_list ; unsigned int queue_len ; unsigned char index ; spinlock_t lock ; wait_queue_head_t queue_wait ; struct batadv_priv *bat_priv ; }; struct batadv_socket_packet { struct list_head list ; size_t icmp_len ; uint8_t icmp_packet[116U] ; }; enum hrtimer_restart; struct skb_seq_state { __u32 lower_offset ; __u32 upper_offset ; __u32 frag_idx ; __u32 stepped_offset ; struct sk_buff *root_skb ; struct sk_buff *cur_skb ; __u8 *frag_data ; }; union __anonunion_ldv_47901_278 { __be32 a4 ; __be32 a6[4U] ; }; struct inetpeer_addr_base { union __anonunion_ldv_47901_278 ldv_47901 ; }; struct inetpeer_addr { struct inetpeer_addr_base addr ; __u16 family ; }; union __anonunion_ldv_47916_279 { struct list_head gc_list ; struct callback_head gc_rcu ; }; struct __anonstruct_ldv_47920_281 { atomic_t rid ; }; union __anonunion_ldv_47923_280 { struct __anonstruct_ldv_47920_281 ldv_47920 ; struct callback_head rcu ; struct inet_peer *gc_next ; }; struct inet_peer { struct inet_peer *avl_left ; struct inet_peer *avl_right ; struct inetpeer_addr daddr ; __u32 avl_height ; u32 metrics[15U] ; u32 rate_tokens ; unsigned long rate_last ; union __anonunion_ldv_47916_279 ldv_47916 ; union __anonunion_ldv_47923_280 ldv_47923 ; __u32 dtime ; atomic_t refcnt ; }; struct inet_peer_base { struct inet_peer *root ; seqlock_t lock ; u32 flush_seq ; int total ; }; struct rtable { struct dst_entry dst ; int rt_genid ; unsigned int rt_flags ; __u16 rt_type ; __u8 rt_is_input ; __u8 rt_uses_gateway ; int rt_iif ; __be32 rt_gateway ; u32 rt_pmtu ; struct list_head rt_uncached ; }; struct batadv_unicast_tvlv_packet { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t reserved ; uint8_t dst[6U] ; uint8_t src[6U] ; __be16 tvlv_len ; uint16_t align ; }; struct batadv_tvlv_hdr { uint8_t type ; uint8_t version ; __be16 len ; }; struct batadv_vlan_tt { uint32_t crc ; atomic_t num_entries ; }; struct batadv_softif_vlan { unsigned short vid ; struct kobject *kobj ; atomic_t ap_isolation ; struct batadv_vlan_tt tt ; struct hlist_node list ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_tvlv_container { struct hlist_node list ; struct batadv_tvlv_hdr tvlv_hdr ; atomic_t refcount ; }; struct batadv_tvlv_handler { struct hlist_node list ; void (*ogm_handler)(struct batadv_priv * , struct batadv_orig_node * , uint8_t , void * , uint16_t ) ; int (*unicast_handler)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ) ; uint8_t type ; uint8_t version ; uint8_t flags ; atomic_t refcount ; struct callback_head rcu ; }; enum hrtimer_restart; struct batadv_coded_packet { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t first_ttvn ; uint8_t first_source[6U] ; uint8_t first_orig_dest[6U] ; __be32 first_crc ; uint8_t second_ttl ; uint8_t second_ttvn ; uint8_t second_dest[6U] ; uint8_t second_source[6U] ; uint8_t second_orig_dest[6U] ; __be32 second_crc ; __be16 coded_len ; }; struct batadv_nc_node { struct list_head list ; uint8_t addr[6U] ; atomic_t refcount ; struct callback_head rcu ; struct batadv_orig_node *orig_node ; unsigned long last_seen ; }; struct batadv_nc_path { struct hlist_node hash_entry ; struct callback_head rcu ; atomic_t refcount ; struct list_head packet_list ; spinlock_t packet_list_lock ; uint8_t next_hop[6U] ; uint8_t prev_hop[6U] ; unsigned long last_valid ; }; struct batadv_nc_packet { struct list_head list ; __be32 packet_id ; unsigned long timestamp ; struct batadv_neigh_node *neigh_node ; struct sk_buff *skb ; struct batadv_nc_path *nc_path ; }; struct batadv_skb_cb { bool decoded ; }; enum hrtimer_restart; struct batadv_orig_node_vlan { unsigned short vid ; struct batadv_vlan_tt tt ; struct list_head list ; atomic_t refcount ; struct callback_head rcu ; }; struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 18 ; unsigned char flags ; }; enum hrtimer_restart; struct batadv_icmp_packet { uint8_t packet_type ; uint8_t version ; uint8_t ttl ; uint8_t msg_type ; uint8_t dst[6U] ; uint8_t orig[6U] ; uint8_t uid ; uint8_t reserved ; __be16 seqno ; }; enum hrtimer_restart; enum hrtimer_restart; enum batadv_forw_mode { BATADV_FORW_ALL = 0, BATADV_FORW_SINGLE = 1, BATADV_FORW_NONE = 2 } ; struct __anonstruct_batadv_counters_strings_279 { char const name[32U] ; }; enum hrtimer_restart; enum kobject_action { KOBJ_ADD = 0, KOBJ_REMOVE = 1, KOBJ_CHANGE = 2, KOBJ_MOVE = 3, KOBJ_ONLINE = 4, KOBJ_OFFLINE = 5, KOBJ_MAX = 6 } ; struct batadv_attribute { struct attribute attr ; ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char * , size_t ) ; }; enum hrtimer_restart; struct batadv_tvlv_tt_data { uint8_t flags ; uint8_t ttvn ; __be16 num_vlan ; }; struct batadv_tvlv_tt_vlan_data { __be32 crc ; __be16 vid ; uint16_t reserved ; }; struct batadv_tvlv_tt_change { uint8_t flags ; uint8_t reserved[3U] ; uint8_t addr[6U] ; __be16 vid ; }; struct batadv_tvlv_roam_adv { uint8_t client[6U] ; __be16 vid ; }; struct batadv_tt_common_entry { uint8_t addr[6U] ; unsigned short vid ; struct hlist_node hash_entry ; uint16_t flags ; unsigned long added_at ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_tt_local_entry { struct batadv_tt_common_entry common ; unsigned long last_seen ; }; struct batadv_tt_global_entry { struct batadv_tt_common_entry common ; struct hlist_head orig_list ; atomic_t orig_list_count ; spinlock_t list_lock ; unsigned long roam_at ; }; struct batadv_tt_orig_list_entry { struct batadv_orig_node *orig_node ; uint8_t ttvn ; struct hlist_node list ; atomic_t refcount ; struct callback_head rcu ; }; struct batadv_tt_change_node { struct list_head list ; struct batadv_tvlv_tt_change change ; }; struct batadv_tt_req_node { uint8_t addr[6U] ; unsigned long issued_at ; struct list_head list ; }; struct batadv_tt_roam_node { uint8_t addr[6U] ; atomic_t counter ; unsigned long first_time ; struct list_head list ; }; typedef __u64 __be64; enum hrtimer_restart; struct netdev_hw_addr { struct list_head list ; unsigned char addr[32U] ; unsigned char type ; bool global_use ; int sync_cnt ; int refcount ; int synced ; struct callback_head callback_head ; }; struct batadv_tvlv_mcast_data { uint8_t flags ; uint8_t reserved[3U] ; }; struct batadv_hw_addr { struct hlist_node list ; unsigned char addr[6U] ; }; typedef struct page___0 *pgtable_t___0; struct __anonstruct____missing_field_name_211 { unsigned int inuse : 16 ; unsigned int objects : 15 ; unsigned int frozen : 1 ; }; union __anonunion____missing_field_name_210 { atomic_t _mapcount ; struct __anonstruct____missing_field_name_211 __annonCompField39 ; int units ; }; struct __anonstruct____missing_field_name_209 { union __anonunion____missing_field_name_210 __annonCompField40 ; atomic_t _count ; }; union __anonunion____missing_field_name_208 { unsigned long counters ; struct __anonstruct____missing_field_name_209 __annonCompField41 ; unsigned int active ; }; struct __anonstruct____missing_field_name_206 { union __anonunion_ldv_14126_140 __annonCompField38 ; union __anonunion____missing_field_name_208 __annonCompField42 ; }; struct __anonstruct____missing_field_name_213 { struct page___0 *next ; int pages ; int pobjects ; }; union __anonunion____missing_field_name_212 { struct list_head lru ; struct __anonstruct____missing_field_name_213 __annonCompField44 ; struct slab *slab_page ; struct callback_head callback_head ; pgtable_t___0 pmd_huge_pte ; }; union __anonunion____missing_field_name_214 { unsigned long private ; spinlock_t *ptl ; struct kmem_cache___0 *slab_cache ; struct page___0 *first_page ; }; struct page___0 { unsigned long flags ; union __anonunion_ldv_14120_138 __annonCompField37 ; struct __anonstruct____missing_field_name_206 __annonCompField43 ; union __anonunion____missing_field_name_212 __annonCompField45 ; union __anonunion____missing_field_name_214 __annonCompField46 ; unsigned long debug_flags ; } __attribute__((__aligned__((2) * (sizeof(unsigned long )) ))) ; enum kobj_ns_type; struct attribute___0 { char const *name ; umode_t mode ; bool ignore_lockdep : 1 ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct sysfs_ops___0 { ssize_t (*show)(struct kobject___0 * , struct attribute___0 * , char * ) ; ssize_t (*store)(struct kobject___0 * , struct attribute___0 * , char const * , size_t ) ; }; struct kobject___0 { char const *name ; struct list_head entry ; struct kobject___0 *parent ; struct kset *kset ; struct kobj_type___0 *ktype ; struct kernfs_node *sd ; struct kref kref ; struct delayed_work release ; unsigned int state_initialized : 1 ; unsigned int state_in_sysfs : 1 ; unsigned int state_add_uevent_sent : 1 ; unsigned int state_remove_uevent_sent : 1 ; unsigned int uevent_suppress : 1 ; }; struct kobj_type___0 { void (*release)(struct kobject___0 *kobj ) ; struct sysfs_ops___0 const *sysfs_ops ; struct attribute___0 **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject___0 *kobj ) ; void const *(*namespace)(struct kobject___0 *kobj ) ; }; struct kmem_cache_cpu___0 { void **freelist ; unsigned long tid ; struct page___0 *page ; struct page___0 *partial ; unsigned int stat[26] ; }; struct kmem_cache___0 { struct kmem_cache_cpu___0 *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int object_size ; int offset ; int cpu_partial ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject___0 kobj ; struct memcg_cache_params___0 *memcg_params ; int max_attr_size ; struct kset *memcg_kset ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1 << 10] ; }; struct __anonstruct____missing_field_name_227 { struct callback_head callback_head ; struct kmem_cache___0 *memcg_caches[0] ; }; struct __anonstruct____missing_field_name_228 { struct mem_cgroup *memcg ; struct list_head list ; struct kmem_cache___0 *root_cache ; atomic_t nr_pages ; }; union __anonunion____missing_field_name_226 { struct __anonstruct____missing_field_name_227 __annonCompField50 ; struct __anonstruct____missing_field_name_228 __annonCompField51 ; }; struct memcg_cache_params___0 { bool is_root_cache ; union __anonunion____missing_field_name_226 __annonCompField52 ; }; long ldv__builtin_expect(long exp , long c ) ; void ldv_spin_lock(void) ; void ldv_spin_unlock(void) ; __inline static void set_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static int variable_test_bit(long nr , unsigned long const volatile *addr ) { int oldbit ; { __asm__ volatile ("bt %2,%1\n\tsbb %0,%0": "=r" (oldbit): "m" (*((unsigned long *)addr)), "Ir" (nr)); return (oldbit); } } __inline static __u32 __arch_swab32(__u32 val ) { { __asm__ ("bswapl %0": "=r" (val): "0" (val)); return (val); } } __inline static __u16 __fswab16(__u16 val ) { { return ((__u16 )((int )((short )((int )val << 8)) | (int )((short )((int )val >> 8)))); } } __inline static __u32 __fswab32(__u32 val ) { __u32 tmp ; { tmp = __arch_swab32(val); return (tmp); } } extern int printk(char const * , ...) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } __inline static int hlist_empty(struct hlist_head const *h ) { { return ((unsigned long )h->first == (unsigned long )((struct hlist_node */* const */)0)); } } __inline static void hlist_add_head(struct hlist_node *n , struct hlist_head *h ) { struct hlist_node *first ; { first = h->first; n->next = first; if ((unsigned long )first != (unsigned long )((struct hlist_node *)0)) { first->pprev = & n->next; } else { } h->first = n; n->pprev = & h->first; return; } } extern void __bad_percpu_size(void) ; extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; extern void warn_slowpath_null(char const * , int const ) ; extern int __bitmap_weight(unsigned long const * , int ) ; __inline static int bitmap_weight(unsigned long const *src , int nbits ) { int tmp___0 ; { tmp___0 = __bitmap_weight(src, nbits); return (tmp___0); } } extern void __cmpxchg_wrong_size(void) ; __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } __inline static void atomic_set(atomic_t *v , int i ) { { v->counter = i; return; } } __inline static void atomic_inc(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; incl %0": "+m" (v->counter)); return; } } __inline static int atomic_dec_and_test(atomic_t *v ) { char c ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0; sete %1": "+m" (v->counter), "=qm" (c): : "memory"); return ((int )((signed char )c) != 0); } } __inline static int atomic_cmpxchg(atomic_t *v , int old , int new ) { int __ret ; int __old ; int __new ; u8 volatile *__ptr ; u16 volatile *__ptr___0 ; u32 volatile *__ptr___1 ; u64 volatile *__ptr___2 ; { __old = old; __new = new; switch (4UL) { case 1UL: __ptr = (u8 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgb %2,%1": "=a" (__ret), "+m" (*__ptr): "q" (__new), "0" (__old): "memory"); goto ldv_5646; case 2UL: __ptr___0 = (u16 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgw %2,%1": "=a" (__ret), "+m" (*__ptr___0): "r" (__new), "0" (__old): "memory"); goto ldv_5646; case 4UL: __ptr___1 = (u32 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgl %2,%1": "=a" (__ret), "+m" (*__ptr___1): "r" (__new), "0" (__old): "memory"); goto ldv_5646; case 8UL: __ptr___2 = (u64 volatile *)(& v->counter); __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; cmpxchgq %2,%1": "=a" (__ret), "+m" (*__ptr___2): "r" (__new), "0" (__old): "memory"); goto ldv_5646; default: __cmpxchg_wrong_size(); } ldv_5646: ; return (__ret); } } __inline static int __atomic_add_unless(atomic_t *v , int a , int u ) { int c ; int old ; long tmp ; long tmp___0 ; { c = atomic_read((atomic_t const *)v); ldv_5675: tmp = ldv__builtin_expect(c == u, 0L); if (tmp != 0L) { goto ldv_5674; } else { } old = atomic_cmpxchg(v, c, c + a); tmp___0 = ldv__builtin_expect(old == c, 1L); if (tmp___0 != 0L) { goto ldv_5674; } else { } c = old; goto ldv_5675; ldv_5674: ; return (c); } } __inline static int atomic_add_unless(atomic_t *v , int a , int u ) { int tmp ; { tmp = __atomic_add_unless(v, a, u); return (tmp != u); } } extern int __preempt_count ; __inline static void __preempt_count_add(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (__preempt_count): "qi" (val)); } goto ldv_6061; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6061; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (__preempt_count): "ri" (val)); } goto ldv_6061; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (__preempt_count): "re" (val)); } goto ldv_6061; default: __bad_percpu_size(); } ldv_6061: ; return; } } __inline static void __preempt_count_sub(int val ) { int pao_ID__ ; { pao_ID__ = 0; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (__preempt_count): "qi" (- val)); } goto ldv_6073; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6073; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (__preempt_count): "ri" (- val)); } goto ldv_6073; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (__preempt_count)); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (__preempt_count)); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (__preempt_count): "re" (- val)); } goto ldv_6073; default: __bad_percpu_size(); } ldv_6073: ; return; } } extern void lockdep_init_map(struct lockdep_map * , char const * , struct lock_class_key * , int ) ; extern void lock_acquire(struct lockdep_map * , unsigned int , int , int , int , struct lockdep_map * , unsigned long ) ; extern void lock_release(struct lockdep_map * , int , unsigned long ) ; extern int lock_is_held(struct lockdep_map * ) ; extern void lockdep_rcu_suspicious(char const * , int const , char const * ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; extern void _raw_spin_lock_bh(raw_spinlock_t * ) ; extern void _raw_spin_unlock_bh(raw_spinlock_t * ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->ldv_6347.rlock); } } __inline static void ldv_spin_lock_bh_2(spinlock_t *lock ) { { _raw_spin_lock_bh(& lock->ldv_6347.rlock); return; } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void ldv_spin_unlock_bh_6(spinlock_t *lock ) { { _raw_spin_unlock_bh(& lock->ldv_6347.rlock); return; } } __inline static void spin_unlock_bh(spinlock_t *lock ) ; extern unsigned long volatile jiffies ; extern unsigned int jiffies_to_msecs(unsigned long const ) ; extern unsigned long msecs_to_jiffies(unsigned int const ) ; extern void init_timer_key(struct timer_list * , unsigned int , char const * , struct lock_class_key * ) ; extern void delayed_work_timer_fn(unsigned long ) ; extern void __init_work(struct work_struct * , int ) ; extern bool queue_delayed_work_on(int , struct workqueue_struct * , struct delayed_work * , unsigned long ) ; __inline static bool queue_delayed_work(struct workqueue_struct *wq , struct delayed_work *dwork , unsigned long delay ) { bool tmp ; { tmp = queue_delayed_work_on(8192, wq, dwork, delay); return (tmp); } } extern void __bad_size_call_parameter(void) ; extern void call_rcu_sched(struct callback_head * , void (*)(struct callback_head * ) ) ; __inline static void __rcu_read_lock(void) { { __preempt_count_add(1); __asm__ volatile ("": : : "memory"); return; } } __inline static void __rcu_read_unlock(void) { { __asm__ volatile ("": : : "memory"); __preempt_count_sub(1); return; } } extern bool rcu_is_watching(void) ; extern bool rcu_lockdep_current_cpu_online(void) ; __inline static void rcu_lock_acquire(struct lockdep_map *map ) { { lock_acquire(map, 0U, 0, 2, 0, (struct lockdep_map *)0, (unsigned long )((void *)0)); return; } } __inline static void rcu_lock_release(struct lockdep_map *map ) { { lock_release(map, 1, (unsigned long )((void *)0)); return; } } extern struct lockdep_map rcu_lock_map ; extern int debug_lockdep_rcu_enabled(void) ; __inline static int rcu_read_lock_held(void) { int tmp ; bool tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = debug_lockdep_rcu_enabled(); if (tmp == 0) { return (1); } else { } tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { } tmp___2 = rcu_lockdep_current_cpu_online(); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (0); } else { } tmp___4 = lock_is_held(& rcu_lock_map); return (tmp___4); } } __inline static void rcu_read_lock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { __rcu_read_lock(); rcu_lock_acquire(& rcu_lock_map); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 871, "rcu_read_lock() used illegally while idle"); } else { } } else { } return; } } __inline static void rcu_read_unlock(void) { bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; { tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_is_watching(); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { __warned = 1; lockdep_rcu_suspicious("include/linux/rcupdate.h", 892, "rcu_read_unlock() used illegally while idle"); } else { } } else { } rcu_lock_release(& rcu_lock_map); __rcu_read_unlock(); return; } } extern void kfree(void const * ) ; extern void *__kmalloc(size_t , gfp_t ) ; extern void *kmem_cache_alloc(struct kmem_cache * , gfp_t ) ; void *ldv_kmem_cache_alloc_16(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_33(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *ldv_kmalloc_12(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; void ldv_check_alloc_flags(gfp_t flags ) ; extern void *malloc(size_t size ) ; extern void *calloc(size_t nmemb , size_t size ) ; extern int __VERIFIER_nondet_int(void) ; extern unsigned long __VERIFIER_nondet_ulong(void) ; extern void *__VERIFIER_nondet_pointer(void) ; extern void __VERIFIER_assume(int expression ) ; void *ldv_malloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = malloc(size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } void *ldv_zalloc(size_t size ) { void *p ; void *tmp ; int tmp___0 ; { tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { return ((void *)0); } else { tmp = calloc(1UL, size); p = tmp; __VERIFIER_assume((unsigned long )p != (unsigned long )((void *)0)); return (p); } } } int ldv_undef_int(void) { int tmp ; { tmp = __VERIFIER_nondet_int(); return (tmp); } } void *ldv_undef_ptr(void) { void *tmp ; { tmp = __VERIFIER_nondet_pointer(); return (tmp); } } unsigned long ldv_undef_ulong(void) { unsigned long tmp ; { tmp = __VERIFIER_nondet_ulong(); return (tmp); } } __inline static void ldv_error(void) { { ERROR: ; __VERIFIER_error(); } } __inline static void ldv_stop(void) { { LDV_STOP: ; goto LDV_STOP; } } long ldv__builtin_expect(long exp , long c ) { { return (exp); } } void ldv__builtin_trap(void) { { ldv_error(); return; } } struct batadv_neigh_node *batadv_batman_iv_group3 ; struct batadv_hard_iface *batadv_batman_iv_group4 ; int LDV_IN_INTERRUPT = 1; struct batadv_orig_node *batadv_batman_iv_group1 ; int ldv_state_variable_36 ; struct batadv_hard_iface *batadv_batman_iv_group2 ; struct batadv_neigh_node *batadv_batman_iv_group0 ; void ldv_initialize_batadv_algo_ops_36(void) ; extern int seq_puts(struct seq_file * , char const * ) ; extern int seq_printf(struct seq_file * , char const * , ...) ; extern void __compiletime_assert_402(void) ; __inline static void hlist_add_head_rcu(struct hlist_node *n , struct hlist_head *h ) { struct hlist_node *first ; bool __cond ; { first = h->first; n->next = first; n->pprev = & h->first; __cond = 0; if ((int )__cond) { __compiletime_assert_402(); } else { } __asm__ volatile ("": : : "memory"); *((struct hlist_node * volatile *)(& h->first)) = n; if ((unsigned long )first != (unsigned long )((struct hlist_node *)0)) { first->pprev = & n->next; } else { } return; } } extern void get_random_bytes(void * , int ) ; extern u32 prandom_u32(void) ; extern void kfree_skb(struct sk_buff * ) ; extern struct sk_buff *skb_clone(struct sk_buff * , gfp_t ) ; struct sk_buff *ldv_skb_clone_24(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_32(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_34(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; extern struct sk_buff *skb_copy(struct sk_buff const * , gfp_t ) ; struct sk_buff *ldv_skb_copy_26(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_35(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; extern int pskb_expand_head(struct sk_buff * , int , int , gfp_t ) ; int ldv_pskb_expand_head_22(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_30(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_31(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; __inline static unsigned int skb_headlen(struct sk_buff const *skb ) { { return ((unsigned int )skb->len - (unsigned int )skb->data_len); } } extern unsigned char *skb_put(struct sk_buff * , unsigned int ) ; __inline static void skb_reserve(struct sk_buff *skb , int len ) { { skb->data = skb->data + (unsigned long )len; skb->tail = skb->tail + (sk_buff_data_t )len; return; } } __inline static unsigned char *skb_mac_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->mac_header); } } extern struct sk_buff *__netdev_alloc_skb(struct net_device * , unsigned int , gfp_t ) ; struct sk_buff *ldv___netdev_alloc_skb_27(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_28(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_29(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev , unsigned int length , gfp_t gfp ) { struct sk_buff *skb ; struct sk_buff *tmp ; { tmp = ldv___netdev_alloc_skb_29(dev, length, gfp); skb = tmp; return (skb); } } __inline static struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = __netdev_alloc_skb_ip_align(dev, length, 32U); return (tmp); } } __inline static struct ethhdr *eth_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_mac_header(skb); return ((struct ethhdr *)tmp); } } __inline static void *netdev_priv(struct net_device const *dev ) { { return ((void *)dev + 3264U); } } __inline static void ether_addr_copy(u8 *dst , u8 const *src ) { { *((u32 *)dst) = *((u32 const *)src); *((u16 *)dst + 4U) = *((u16 const *)src + 4U); return; } } __inline static bool ether_addr_equal(u8 const *addr1 , u8 const *addr2 ) { u32 fold ; { fold = ((unsigned int )*((u32 const *)addr1) ^ (unsigned int )*((u32 const *)addr2)) | (unsigned int )((int )((unsigned short )*((u16 const *)addr1 + 4U)) ^ (int )((unsigned short )*((u16 const *)addr2 + 4U))); return (fold == 0U); } } __inline static bool ether_addr_equal_unaligned(u8 const *addr1 , u8 const *addr2 ) { bool tmp ; { tmp = ether_addr_equal(addr1, addr2); return (tmp); } } __inline static int batadv_test_bit(unsigned long const *seq_bits , uint32_t last_seqno , uint32_t curr_seqno ) { int32_t diff ; int tmp ; { diff = (int32_t )(last_seqno - curr_seqno); if (diff < 0 || diff > 63) { return (0); } else { tmp = variable_test_bit((long )diff, (unsigned long const volatile *)seq_bits); return (tmp != 0); } } } __inline static void batadv_set_bit(unsigned long *seq_bits , int32_t n ) { { if (n < 0 || n > 63) { return; } else { } set_bit((long )n, (unsigned long volatile *)seq_bits); return; } } int batadv_bit_get_packet(void *priv , unsigned long *seq_bits , int32_t seq_num_diff , int set_mark ) ; struct list_head batadv_hardif_list ; unsigned char batadv_broadcast_addr[6U] ; struct workqueue_struct *batadv_event_workqueue ; int batadv_recv_handler_register(uint8_t packet_type , int (*recv_handler)(struct sk_buff * , struct batadv_hard_iface * ) ) ; void batadv_recv_handler_unregister(uint8_t packet_type ) ; int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops ) ; int batadv_debug_log(struct batadv_priv *bat_priv , char const *fmt , ...) ; __inline static int batadv_compare_eth(void const *data1 , void const *data2 ) { bool tmp ; { tmp = ether_addr_equal_unaligned((u8 const *)data1, (u8 const *)data2); return ((int )tmp); } } __inline static void batadv_add_counter(struct batadv_priv *bat_priv , size_t idx , size_t count ) { void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; { __vpp_verify = (void const *)0; switch (8UL) { case 1UL: pao_ID__ = 0; switch (8UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49259; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49259; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49259; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49259; default: __bad_percpu_size(); } ldv_49259: ; goto ldv_49264; case 2UL: pao_ID_____0 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49270; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49270; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49270; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49270; default: __bad_percpu_size(); } ldv_49270: ; goto ldv_49264; case 4UL: pao_ID_____1 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49280; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49280; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49280; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49280; default: __bad_percpu_size(); } ldv_49280: ; goto ldv_49264; case 8UL: pao_ID_____2 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49290; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49290; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49290; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49290; default: __bad_percpu_size(); } ldv_49290: ; goto ldv_49264; default: __bad_size_call_parameter(); goto ldv_49264; } ldv_49264: ; return; } } uint16_t batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv , unsigned char **packet_buff , int *packet_buff_len , int packet_min_len ) ; void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv , struct batadv_ogm_packet *batadv_ogm_packet , struct batadv_orig_node *orig_node ) ; void batadv_tt_local_commit_changes(struct batadv_priv *bat_priv ) ; __inline static int batadv_hash_add(struct batadv_hashtable *hash , int (*compare)(struct hlist_node const * , void const * ) , uint32_t (*choose)(void const * , uint32_t ) , void const *data , struct hlist_node *data_node ) { uint32_t index ; int ret ; struct hlist_head *head ; struct hlist_node *node ; spinlock_t *list_lock ; int tmp ; { ret = -1; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { goto out; } else { } index = (*choose)(data, hash->size); head = hash->table + (unsigned long )index; list_lock = hash->list_locks + (unsigned long )index; spin_lock_bh(list_lock); node = head->first; goto ldv_49500; ldv_49499: tmp = (*compare)((struct hlist_node const *)node, data); if (tmp == 0) { goto ldv_49497; } else { } ret = 1; goto unlock; ldv_49497: node = node->next; ldv_49500: ; if ((unsigned long )node != (unsigned long )((struct hlist_node *)0)) { goto ldv_49499; } else { } hlist_add_head_rcu(data_node, head); ret = 0; unlock: spin_unlock_bh(list_lock); out: ; return (ret); } } int batadv_compare_orig(struct hlist_node const *node , void const *data2 ) ; void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node ) ; struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv , uint8_t const *addr ) ; struct batadv_neigh_node *batadv_neigh_node_get(struct batadv_orig_node const *orig_node , struct batadv_hard_iface const *hard_iface , uint8_t const *addr ) ; struct batadv_neigh_node *batadv_neigh_node_new(struct batadv_hard_iface *hard_iface , uint8_t const *neigh_addr , struct batadv_orig_node *orig_node ) ; void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node ) ; struct batadv_neigh_node *batadv_orig_router_get(struct batadv_orig_node *orig_node , struct batadv_hard_iface const *if_outgoing ) ; struct batadv_neigh_ifinfo *batadv_neigh_ifinfo_new(struct batadv_neigh_node *neigh , struct batadv_hard_iface *if_outgoing ) ; struct batadv_neigh_ifinfo *batadv_neigh_ifinfo_get(struct batadv_neigh_node *neigh , struct batadv_hard_iface *if_outgoing ) ; void batadv_neigh_ifinfo_free_ref(struct batadv_neigh_ifinfo *neigh_ifinfo ) ; struct batadv_orig_ifinfo *batadv_orig_ifinfo_new(struct batadv_orig_node *orig_node , struct batadv_hard_iface *if_outgoing ) ; void batadv_orig_ifinfo_free_ref(struct batadv_orig_ifinfo *orig_ifinfo ) ; __inline static uint32_t batadv_choose_orig(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49589; ldv_49588: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49589: ; if (i <= 5UL) { goto ldv_49588; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_49623; ldv_49622: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_49620; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49620; } else { } orig_node_tmp = orig_node; goto ldv_49621; ldv_49620: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_49623: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49622; } else { } ldv_49621: rcu_read_unlock(); return (orig_node_tmp); } } bool batadv_check_management_packet(struct sk_buff *skb , struct batadv_hard_iface *hard_iface , int header_len ) ; void batadv_update_route(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_hard_iface *recv_if , struct batadv_neigh_node *neigh_node ) ; int batadv_window_protected(struct batadv_priv *bat_priv , int32_t seq_num_diff , unsigned long *last_reset ) ; bool batadv_is_wifi_netdev(struct net_device *net_device ) ; void batadv_hardif_free_rcu(struct callback_head *rcu ) ; __inline static void batadv_hardif_free_ref(struct batadv_hard_iface *hard_iface ) { int tmp ; { tmp = atomic_dec_and_test(& hard_iface->refcount); if (tmp != 0) { call_rcu_sched(& hard_iface->rcu, & batadv_hardif_free_rcu); } else { } return; } } __inline static struct batadv_hard_iface *batadv_primary_if_get_selected(struct batadv_priv *bat_priv ) { struct batadv_hard_iface *hard_iface ; struct batadv_hard_iface *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; int tmp___1 ; { rcu_read_lock(); _________p1 = *((struct batadv_hard_iface * volatile *)(& bat_priv->primary_if)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_held(); if (tmp___0 == 0 && 1) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/inst/current/envs/linux-3.16-rc1.tar.xz/linux-3.16-rc1/net/batman-adv/hard-interface.h", 85, "suspicious rcu_dereference_check() usage"); } else { } } else { } hard_iface = _________p1; if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } tmp___1 = atomic_add_unless(& hard_iface->refcount, 1, 0); if (tmp___1 == 0) { hard_iface = (struct batadv_hard_iface *)0; } else { } out: rcu_read_unlock(); return (hard_iface); } } int batadv_send_skb_packet(struct sk_buff *skb , struct batadv_hard_iface *hard_iface , uint8_t const *dst_addr ) ; void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work ) ; int batadv_iv_init(void) ; void batadv_nc_update_nc_node(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_orig_node *orig_neigh_node , struct batadv_ogm_packet *ogm_packet , int is_single_hop_neigh ) ; static void batadv_ring_buffer_set(uint8_t *lq_recv , uint8_t *lq_index , uint8_t value ) { { *(lq_recv + (unsigned long )*lq_index) = value; *lq_index = (uint8_t )(((int )*lq_index + 1) % 5); return; } } static uint8_t batadv_ring_buffer_avg(uint8_t const *lq_recv ) { uint8_t const *ptr ; uint16_t count ; uint16_t i ; uint16_t sum ; { count = 0U; i = 0U; sum = 0U; ptr = lq_recv; goto ldv_49870; ldv_49869: ; if ((unsigned int )((unsigned char )*ptr) != 0U) { count = (uint16_t )((int )count + 1); sum = (int )((uint16_t )*ptr) + (int )sum; } else { } i = (uint16_t )((int )i + 1); ptr = ptr + 1; ldv_49870: ; if ((unsigned int )i <= 4U) { goto ldv_49869; } else { } if ((unsigned int )count == 0U) { return (0U); } else { } return ((uint8_t )((int )sum / (int )count)); } } static void batadv_iv_ogm_orig_free(struct batadv_orig_node *orig_node ) { { kfree((void const *)orig_node->bat_iv.bcast_own); kfree((void const *)orig_node->bat_iv.bcast_own_sum); return; } } static int batadv_iv_ogm_orig_add_if(struct batadv_orig_node *orig_node , int max_if_num ) { void *data_ptr ; size_t data_size ; size_t old_size ; int ret ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; { ret = -12; spin_lock_bh(& orig_node->bat_iv.ogm_cnt_lock); data_size = (unsigned long )max_if_num * 8UL; old_size = (unsigned long )(max_if_num + -1) * 8UL; data_ptr = kmalloc(data_size, 32U); if ((unsigned long )data_ptr == (unsigned long )((void *)0)) { goto unlock; } else { } __len = old_size; __ret = __builtin_memcpy(data_ptr, (void const *)orig_node->bat_iv.bcast_own, __len); kfree((void const *)orig_node->bat_iv.bcast_own); orig_node->bat_iv.bcast_own = (unsigned long *)data_ptr; data_ptr = kmalloc((unsigned long )max_if_num, 32U); if ((unsigned long )data_ptr == (unsigned long )((void *)0)) { kfree((void const *)orig_node->bat_iv.bcast_own); goto unlock; } else { } __len___0 = (unsigned long )(max_if_num + -1); __ret___0 = __builtin_memcpy(data_ptr, (void const *)orig_node->bat_iv.bcast_own_sum, __len___0); kfree((void const *)orig_node->bat_iv.bcast_own_sum); orig_node->bat_iv.bcast_own_sum = (uint8_t *)data_ptr; ret = 0; unlock: spin_unlock_bh(& orig_node->bat_iv.ogm_cnt_lock); return (ret); } } static int batadv_iv_ogm_orig_del_if(struct batadv_orig_node *orig_node , int max_if_num , int del_if_num ) { int chunk_size ; int ret ; int if_offset ; void *data_ptr ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; size_t __len___1 ; void *__ret___1 ; size_t __len___2 ; void *__ret___2 ; { ret = -12; data_ptr = (void *)0; spin_lock_bh(& orig_node->bat_iv.ogm_cnt_lock); if (max_if_num == 0) { goto free_bcast_own; } else { } chunk_size = 8; data_ptr = kmalloc((size_t )(max_if_num * chunk_size), 32U); if ((unsigned long )data_ptr == (unsigned long )((void *)0)) { goto unlock; } else { } __len = (size_t )(del_if_num * chunk_size); __ret = __builtin_memcpy(data_ptr, (void const *)orig_node->bat_iv.bcast_own, __len); __len___0 = (size_t )((max_if_num - del_if_num) * chunk_size); __ret___0 = __builtin_memcpy(data_ptr + (unsigned long )(del_if_num * chunk_size), (void const *)orig_node->bat_iv.bcast_own + (unsigned long )((del_if_num + 1) * chunk_size), __len___0); free_bcast_own: kfree((void const *)orig_node->bat_iv.bcast_own); orig_node->bat_iv.bcast_own = (unsigned long *)data_ptr; if (max_if_num == 0) { goto free_own_sum; } else { } data_ptr = kmalloc((unsigned long )max_if_num, 32U); if ((unsigned long )data_ptr == (unsigned long )((void *)0)) { kfree((void const *)orig_node->bat_iv.bcast_own); goto unlock; } else { } __len___1 = (unsigned long )del_if_num; __ret___1 = __builtin_memcpy(data_ptr, (void const *)orig_node->bat_iv.bcast_own_sum, __len___1); if_offset = del_if_num + 1; __len___2 = (unsigned long )(max_if_num - del_if_num); __ret___2 = __builtin_memcpy(data_ptr + (unsigned long )del_if_num, (void const *)orig_node->bat_iv.bcast_own_sum + (unsigned long )if_offset, __len___2); free_own_sum: kfree((void const *)orig_node->bat_iv.bcast_own_sum); orig_node->bat_iv.bcast_own_sum = (uint8_t *)data_ptr; ret = 0; unlock: spin_unlock_bh(& orig_node->bat_iv.ogm_cnt_lock); return (ret); } } static struct batadv_orig_node *batadv_iv_ogm_orig_get(struct batadv_priv *bat_priv , uint8_t const *addr ) { struct batadv_orig_node *orig_node ; int size ; int hash_added ; struct lock_class_key __key ; void *tmp ; void *tmp___0 ; { orig_node = batadv_orig_hash_find(bat_priv, (void const *)addr); if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { return (orig_node); } else { } orig_node = batadv_orig_node_new(bat_priv, addr); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return ((struct batadv_orig_node *)0); } else { } spinlock_check(& orig_node->bat_iv.ogm_cnt_lock); __raw_spin_lock_init(& orig_node->bat_iv.ogm_cnt_lock.ldv_6347.rlock, "&(&orig_node->bat_iv.ogm_cnt_lock)->rlock", & __key); size = (int )((unsigned int )bat_priv->num_ifaces * 8U); tmp = kzalloc((size_t )size, 32U); orig_node->bat_iv.bcast_own = (unsigned long *)tmp; if ((unsigned long )orig_node->bat_iv.bcast_own == (unsigned long )((unsigned long *)0UL)) { goto free_orig_node; } else { } size = (int )bat_priv->num_ifaces; tmp___0 = kzalloc((size_t )size, 32U); orig_node->bat_iv.bcast_own_sum = (uint8_t *)tmp___0; if ((unsigned long )orig_node->bat_iv.bcast_own_sum == (unsigned long )((uint8_t *)0U)) { goto free_orig_node; } else { } hash_added = batadv_hash_add(bat_priv->orig_hash, & batadv_compare_orig, & batadv_choose_orig, (void const *)orig_node, & orig_node->hash_entry); if (hash_added != 0) { goto free_orig_node; } else { } return (orig_node); free_orig_node: batadv_orig_node_free_ref(orig_node); batadv_orig_node_free_ref(orig_node); return ((struct batadv_orig_node *)0); } } static struct batadv_neigh_node *batadv_iv_ogm_neigh_new(struct batadv_hard_iface *hard_iface , uint8_t const *neigh_addr , struct batadv_orig_node *orig_node , struct batadv_orig_node *orig_neigh ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_neigh_node *neigh_node ; struct batadv_neigh_node *tmp_neigh_node ; int tmp___0 ; int tmp___1 ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; neigh_node = batadv_neigh_node_new(hard_iface, neigh_addr, orig_node); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } tmp___0 = atomic_add_unless(& hard_iface->refcount, 1, 0); if (tmp___0 == 0) { kfree((void const *)neigh_node); neigh_node = (struct batadv_neigh_node *)0; goto out; } else { } neigh_node->orig_node = orig_neigh; neigh_node->if_incoming = hard_iface; spin_lock_bh(& orig_node->neigh_list_lock); tmp_neigh_node = batadv_neigh_node_get((struct batadv_orig_node const *)orig_node, (struct batadv_hard_iface const *)hard_iface, neigh_addr); if ((unsigned long )tmp_neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { hlist_add_head_rcu(& neigh_node->list, & orig_node->neigh_list); } else { kfree((void const *)neigh_node); batadv_hardif_free_ref(hard_iface); neigh_node = tmp_neigh_node; } spin_unlock_bh(& orig_node->neigh_list_lock); if ((unsigned long )tmp_neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___1 & 1) { batadv_debug_log(bat_priv, "Creating new neighbor %pM for orig_node %pM on interface %s\n", neigh_addr, (uint8_t *)(& orig_node->orig), (char *)(& (hard_iface->net_dev)->name)); } else { } } else { } out: ; return (neigh_node); } } static int batadv_iv_ogm_iface_enable(struct batadv_hard_iface *hard_iface ) { struct batadv_ogm_packet *batadv_ogm_packet ; unsigned char *ogm_buff ; uint32_t random_seqno ; int res ; void *tmp ; { res = -12; get_random_bytes((void *)(& random_seqno), 4); atomic_set(& hard_iface->bat_iv.ogm_seqno, (int )random_seqno); hard_iface->bat_iv.ogm_buff_len = 24; tmp = kmalloc((size_t )hard_iface->bat_iv.ogm_buff_len, 32U); ogm_buff = (unsigned char *)tmp; if ((unsigned long )ogm_buff == (unsigned long )((unsigned char *)0U)) { goto out; } else { } hard_iface->bat_iv.ogm_buff = ogm_buff; batadv_ogm_packet = (struct batadv_ogm_packet *)ogm_buff; batadv_ogm_packet->packet_type = 0U; batadv_ogm_packet->version = 15U; batadv_ogm_packet->ttl = 2U; batadv_ogm_packet->flags = 0U; batadv_ogm_packet->reserved = 0U; batadv_ogm_packet->tq = 255U; res = 0; out: ; return (res); } } static void batadv_iv_ogm_iface_disable(struct batadv_hard_iface *hard_iface ) { { kfree((void const *)hard_iface->bat_iv.ogm_buff); hard_iface->bat_iv.ogm_buff = (unsigned char *)0U; return; } } static void batadv_iv_ogm_iface_update_mac(struct batadv_hard_iface *hard_iface ) { struct batadv_ogm_packet *batadv_ogm_packet ; unsigned char *ogm_buff ; { ogm_buff = hard_iface->bat_iv.ogm_buff; batadv_ogm_packet = (struct batadv_ogm_packet *)ogm_buff; ether_addr_copy((u8 *)(& batadv_ogm_packet->orig), (u8 const *)(hard_iface->net_dev)->dev_addr); ether_addr_copy((u8 *)(& batadv_ogm_packet->prev_sender), (u8 const *)(hard_iface->net_dev)->dev_addr); return; } } static void batadv_iv_ogm_primary_iface_set(struct batadv_hard_iface *hard_iface ) { struct batadv_ogm_packet *batadv_ogm_packet ; unsigned char *ogm_buff ; { ogm_buff = hard_iface->bat_iv.ogm_buff; batadv_ogm_packet = (struct batadv_ogm_packet *)ogm_buff; batadv_ogm_packet->flags = 2U; batadv_ogm_packet->ttl = 50U; return; } } static unsigned long batadv_iv_ogm_emit_send_time(struct batadv_priv const *bat_priv ) { unsigned int msecs ; int tmp ; u32 tmp___0 ; unsigned long tmp___1 ; { tmp = atomic_read(& bat_priv->orig_interval); msecs = (unsigned int )(tmp + -20); tmp___0 = prandom_u32(); msecs = tmp___0 % 40U + msecs; tmp___1 = msecs_to_jiffies(msecs); return (tmp___1 + (unsigned long )jiffies); } } static unsigned long batadv_iv_ogm_fwd_send_time(void) { u32 tmp ; unsigned long tmp___0 ; { tmp = prandom_u32(); tmp___0 = msecs_to_jiffies(tmp % 10U); return (tmp___0 + (unsigned long )jiffies); } } static uint8_t batadv_hop_penalty(uint8_t tq , struct batadv_priv const *bat_priv ) { int hop_penalty ; int tmp ; int new_tq ; { tmp = atomic_read(& bat_priv->hop_penalty); hop_penalty = tmp; new_tq = (int )tq * (255 - hop_penalty); new_tq = new_tq / 255; return ((uint8_t )new_tq); } } static int batadv_iv_ogm_aggr_packet(int buff_pos , int packet_len , __be16 tvlv_len ) { int next_buff_pos ; __u16 tmp ; { next_buff_pos = 0; next_buff_pos = (int )(((unsigned int )next_buff_pos + (unsigned int )buff_pos) + 24U); tmp = __fswab16((int )tvlv_len); next_buff_pos = (int )tmp + next_buff_pos; return (next_buff_pos <= packet_len && next_buff_pos <= 512); } } static void batadv_iv_ogm_send_to_if(struct batadv_forw_packet *forw_packet , struct batadv_hard_iface *hard_iface ) { struct batadv_priv *bat_priv ; void *tmp ; char *fwd_str ; uint8_t packet_num ; int16_t buff_pos ; struct batadv_ogm_packet *batadv_ogm_packet ; struct sk_buff *skb ; uint8_t *packet_pos ; __u32 tmp___0 ; int tmp___1 ; __u16 tmp___2 ; int tmp___3 ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; if ((int )((signed char )hard_iface->if_status) != 3) { return; } else { } packet_num = 0U; buff_pos = 0; packet_pos = (forw_packet->skb)->data; batadv_ogm_packet = (struct batadv_ogm_packet *)packet_pos; goto ldv_49985; ldv_49984: ; if ((int )((unsigned long )forw_packet->direct_link_flags >> (int )packet_num) & 1 && (unsigned long )forw_packet->if_incoming == (unsigned long )hard_iface) { batadv_ogm_packet->flags = (uint8_t )((unsigned int )batadv_ogm_packet->flags | 4U); } else { batadv_ogm_packet->flags = (unsigned int )batadv_ogm_packet->flags & 251U; } if ((unsigned int )packet_num != 0U || (unsigned int )forw_packet->own == 0U) { fwd_str = (char *)"Forwarding"; } else { fwd_str = (char *)"Sending own"; } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___1 & 1) { tmp___0 = __fswab32(batadv_ogm_packet->seqno); batadv_debug_log(bat_priv, "%s %spacket (originator %pM, seqno %u, TQ %d, TTL %d, IDF %s) on interface %s [%pM]\n", fwd_str, (unsigned int )packet_num != 0U ? (char *)"aggregated " : (char *)"", (uint8_t *)(& batadv_ogm_packet->orig), tmp___0, (int )batadv_ogm_packet->tq, (int )batadv_ogm_packet->ttl, ((int )batadv_ogm_packet->flags & 4) != 0 ? (char *)"on" : (char *)"off", (char *)(& (hard_iface->net_dev)->name), (hard_iface->net_dev)->dev_addr); } else { } buff_pos = (int16_t )((unsigned int )((unsigned short )buff_pos) + 24U); tmp___2 = __fswab16((int )batadv_ogm_packet->tvlv_len); buff_pos = (int16_t )((int )tmp___2 + (int )((unsigned short )buff_pos)); packet_num = (uint8_t )((int )packet_num + 1); packet_pos = (forw_packet->skb)->data + (unsigned long )buff_pos; batadv_ogm_packet = (struct batadv_ogm_packet *)packet_pos; ldv_49985: tmp___3 = batadv_iv_ogm_aggr_packet((int )buff_pos, (int )forw_packet->packet_len, (int )batadv_ogm_packet->tvlv_len); if (tmp___3 != 0) { goto ldv_49984; } else { } skb = ldv_skb_clone_34(forw_packet->skb, 32U); if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { batadv_add_counter(bat_priv, 7UL, 1UL); batadv_add_counter(bat_priv, 8UL, (size_t )(skb->len + 14U)); batadv_send_skb_packet(skb, hard_iface, (uint8_t const *)(& batadv_broadcast_addr)); } else { } return; } } static void batadv_iv_ogm_emit(struct batadv_forw_packet *forw_packet ) { struct net_device *soft_iface ; struct batadv_priv *bat_priv ; struct batadv_hard_iface *primary_if ; void *tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; int __ret_warn_on___0 ; long tmp___2 ; long tmp___3 ; { primary_if = (struct batadv_hard_iface *)0; if ((unsigned long )forw_packet->if_incoming == (unsigned long )((struct batadv_hard_iface *)0)) { printk("\vbatman_adv: Error - can\'t forward packet: incoming iface not specified\n"); goto out; } else { } soft_iface = (forw_packet->if_incoming)->soft_iface; tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; __ret_warn_on = (unsigned long )forw_packet->if_outgoing == (unsigned long )((struct batadv_hard_iface *)0); tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/bat_iv_ogm.o.c.prepared", 647); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { goto out; } else { } __ret_warn_on___0 = (unsigned long )(forw_packet->if_outgoing)->soft_iface != (unsigned long )soft_iface; tmp___2 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/bat_iv_ogm.o.c.prepared", 650); } else { } tmp___3 = ldv__builtin_expect(__ret_warn_on___0 != 0, 0L); if (tmp___3 != 0L) { goto out; } else { } if ((int )((signed char )(forw_packet->if_incoming)->if_status) != 3) { goto out; } else { } primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } batadv_iv_ogm_send_to_if(forw_packet, forw_packet->if_outgoing); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } static bool batadv_iv_ogm_can_aggregate(struct batadv_ogm_packet const *new_bat_ogm_packet , struct batadv_priv *bat_priv , int packet_len , unsigned long send_time , bool directlink , struct batadv_hard_iface const *if_incoming , struct batadv_hard_iface const *if_outgoing , struct batadv_forw_packet const *forw_packet ) { struct batadv_ogm_packet *batadv_ogm_packet ; int aggregated_bytes ; struct batadv_hard_iface *primary_if ; bool res ; unsigned long aggregation_end_time ; unsigned long tmp ; { aggregated_bytes = (int )forw_packet->packet_len + packet_len; primary_if = (struct batadv_hard_iface *)0; res = 0; batadv_ogm_packet = (struct batadv_ogm_packet *)(forw_packet->skb)->data; aggregation_end_time = send_time; tmp = msecs_to_jiffies(100U); aggregation_end_time = tmp + aggregation_end_time; if (((long )(send_time - (unsigned long )forw_packet->send_time) < 0L && (long )(aggregation_end_time - (unsigned long )forw_packet->send_time) >= 0L) && aggregated_bytes <= 512) { primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } if ((unsigned long )((struct batadv_hard_iface const *)forw_packet->if_outgoing) != (unsigned long )if_outgoing) { goto out; } else { } if (((! directlink && ((int )batadv_ogm_packet->flags & 4) == 0) && (unsigned int )batadv_ogm_packet->ttl != 1U) && ((unsigned int )((unsigned char )forw_packet->own) == 0U || (unsigned long )((struct batadv_hard_iface *)forw_packet->if_incoming) == (unsigned long )primary_if)) { res = 1; goto out; } else { } if ((((int )directlink && (unsigned int )((unsigned char )new_bat_ogm_packet->ttl) == 1U) && (unsigned long )((struct batadv_hard_iface const *)forw_packet->if_incoming) == (unsigned long )if_incoming) && (((int )batadv_ogm_packet->flags & 4) != 0 || ((unsigned int )((unsigned char )forw_packet->own) != 0U && (unsigned long )((struct batadv_hard_iface *)forw_packet->if_incoming) != (unsigned long )primary_if))) { res = 1; goto out; } else { } } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (res); } } static void batadv_iv_ogm_aggregate_new(unsigned char const *packet_buff , int packet_len , unsigned long send_time , bool direct_link , struct batadv_hard_iface *if_incoming , struct batadv_hard_iface *if_outgoing , int own_packet ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_forw_packet *forw_packet_aggr ; unsigned char *skb_buff ; unsigned int skb_size ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; void *tmp___4 ; int tmp___5 ; size_t __len ; void *__ret ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___0 ; { tmp = netdev_priv((struct net_device const *)if_incoming->soft_iface); bat_priv = (struct batadv_priv *)tmp; tmp___0 = atomic_add_unless(& if_incoming->refcount, 1, 0); if (tmp___0 == 0) { return; } else { } tmp___1 = atomic_add_unless(& if_outgoing->refcount, 1, 0); if (tmp___1 == 0) { goto out_free_incoming; } else { } if (own_packet == 0) { tmp___3 = atomic_add_unless(& bat_priv->batman_queue_left, -1, 0); if (tmp___3 == 0) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___2 & 1) { batadv_debug_log(bat_priv, "batman packet queue full\n"); } else { } goto out; } else { } } else { } tmp___4 = kmalloc(296UL, 32U); forw_packet_aggr = (struct batadv_forw_packet *)tmp___4; if ((unsigned long )forw_packet_aggr == (unsigned long )((struct batadv_forw_packet *)0)) { if (own_packet == 0) { atomic_inc(& bat_priv->batman_queue_left); } else { } goto out; } else { } tmp___5 = atomic_read((atomic_t const *)(& bat_priv->aggregated_ogms)); if (tmp___5 != 0 && packet_len <= 511) { skb_size = 512U; } else { skb_size = (unsigned int )packet_len; } skb_size = skb_size + 14U; forw_packet_aggr->skb = netdev_alloc_skb_ip_align((struct net_device *)0, skb_size); if ((unsigned long )forw_packet_aggr->skb == (unsigned long )((struct sk_buff *)0)) { if (own_packet == 0) { atomic_inc(& bat_priv->batman_queue_left); } else { } kfree((void const *)forw_packet_aggr); goto out; } else { } (forw_packet_aggr->skb)->priority = 7U; skb_reserve(forw_packet_aggr->skb, 14); skb_buff = skb_put(forw_packet_aggr->skb, (unsigned int )packet_len); forw_packet_aggr->packet_len = (uint16_t )packet_len; __len = (size_t )packet_len; __ret = __builtin_memcpy((void *)skb_buff, (void const *)packet_buff, __len); forw_packet_aggr->own = (uint8_t )own_packet; forw_packet_aggr->if_incoming = if_incoming; forw_packet_aggr->if_outgoing = if_outgoing; forw_packet_aggr->num_packets = 0U; forw_packet_aggr->direct_link_flags = 0U; forw_packet_aggr->send_time = send_time; if ((int )direct_link) { forw_packet_aggr->direct_link_flags = forw_packet_aggr->direct_link_flags | 1U; } else { } spin_lock_bh(& bat_priv->forw_bat_list_lock); hlist_add_head(& forw_packet_aggr->list, & bat_priv->forw_bat_list); spin_unlock_bh(& bat_priv->forw_bat_list_lock); __init_work(& forw_packet_aggr->delayed_work.work, 0); __constr_expr_0.counter = 137438953408L; forw_packet_aggr->delayed_work.work.data = __constr_expr_0; lockdep_init_map(& forw_packet_aggr->delayed_work.work.lockdep_map, "(&(&forw_packet_aggr->delayed_work)->work)", & __key, 0); INIT_LIST_HEAD(& forw_packet_aggr->delayed_work.work.entry); forw_packet_aggr->delayed_work.work.func = & batadv_send_outstanding_bat_ogm_packet; init_timer_key(& forw_packet_aggr->delayed_work.timer, 2U, "(&(&forw_packet_aggr->delayed_work)->timer)", & __key___0); forw_packet_aggr->delayed_work.timer.function = & delayed_work_timer_fn; forw_packet_aggr->delayed_work.timer.data = (unsigned long )(& forw_packet_aggr->delayed_work); queue_delayed_work(batadv_event_workqueue, & forw_packet_aggr->delayed_work, send_time - (unsigned long )jiffies); return; out: batadv_hardif_free_ref(if_outgoing); out_free_incoming: batadv_hardif_free_ref(if_incoming); return; } } static void batadv_iv_ogm_aggregate(struct batadv_forw_packet *forw_packet_aggr , unsigned char const *packet_buff , int packet_len , bool direct_link ) { unsigned char *skb_buff ; unsigned long new_direct_link_flag ; size_t __len ; void *__ret ; { skb_buff = skb_put(forw_packet_aggr->skb, (unsigned int )packet_len); __len = (size_t )packet_len; __ret = __builtin_memcpy((void *)skb_buff, (void const *)packet_buff, __len); forw_packet_aggr->packet_len = (int )forw_packet_aggr->packet_len + (int )((uint16_t )packet_len); forw_packet_aggr->num_packets = (uint8_t )((int )forw_packet_aggr->num_packets + 1); if ((int )direct_link) { new_direct_link_flag = 1UL << (int )forw_packet_aggr->num_packets; forw_packet_aggr->direct_link_flags = forw_packet_aggr->direct_link_flags | (uint32_t )new_direct_link_flag; } else { } return; } } static void batadv_iv_ogm_queue_add(struct batadv_priv *bat_priv , unsigned char *packet_buff , int packet_len , struct batadv_hard_iface *if_incoming , struct batadv_hard_iface *if_outgoing , int own_packet , unsigned long send_time ) { struct batadv_forw_packet *forw_packet_aggr ; struct batadv_forw_packet *forw_packet_pos ; struct batadv_ogm_packet *batadv_ogm_packet ; bool direct_link ; unsigned long max_aggregation_jiffies ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_forw_packet *tmp ; bool tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_forw_packet *tmp___1 ; int tmp___2 ; int tmp___3 ; { forw_packet_aggr = (struct batadv_forw_packet *)0; forw_packet_pos = (struct batadv_forw_packet *)0; batadv_ogm_packet = (struct batadv_ogm_packet *)packet_buff; direct_link = ((int )batadv_ogm_packet->flags & 4) != 0; max_aggregation_jiffies = msecs_to_jiffies(100U); spin_lock_bh(& bat_priv->forw_bat_list_lock); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->aggregated_ogms)); if (tmp___2 != 0 && own_packet == 0) { ____ptr = bat_priv->forw_bat_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_forw_packet *)__mptr; } else { tmp = (struct batadv_forw_packet *)0; } forw_packet_pos = tmp; goto ldv_50082; ldv_50081: tmp___0 = batadv_iv_ogm_can_aggregate((struct batadv_ogm_packet const *)batadv_ogm_packet, bat_priv, packet_len, send_time, (int )direct_link, (struct batadv_hard_iface const *)if_incoming, (struct batadv_hard_iface const *)if_outgoing, (struct batadv_forw_packet const *)forw_packet_pos); if ((int )tmp___0) { forw_packet_aggr = forw_packet_pos; goto ldv_50080; } else { } ____ptr___0 = forw_packet_pos->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_forw_packet *)__mptr___0; } else { tmp___1 = (struct batadv_forw_packet *)0; } forw_packet_pos = tmp___1; ldv_50082: ; if ((unsigned long )forw_packet_pos != (unsigned long )((struct batadv_forw_packet *)0)) { goto ldv_50081; } else { } ldv_50080: ; } else { } if ((unsigned long )forw_packet_aggr == (unsigned long )((struct batadv_forw_packet *)0)) { spin_unlock_bh(& bat_priv->forw_bat_list_lock); if (own_packet == 0) { tmp___3 = atomic_read((atomic_t const *)(& bat_priv->aggregated_ogms)); if (tmp___3 != 0) { send_time = send_time + max_aggregation_jiffies; } else { } } else { } batadv_iv_ogm_aggregate_new((unsigned char const *)packet_buff, packet_len, send_time, (int )direct_link, if_incoming, if_outgoing, own_packet); } else { batadv_iv_ogm_aggregate(forw_packet_aggr, (unsigned char const *)packet_buff, packet_len, (int )direct_link); spin_unlock_bh(& bat_priv->forw_bat_list_lock); } return; } } static void batadv_iv_ogm_forward(struct batadv_orig_node *orig_node , struct ethhdr const *ethhdr , struct batadv_ogm_packet *batadv_ogm_packet , bool is_single_hop_neigh , bool is_from_best_next_hop , struct batadv_hard_iface *if_incoming , struct batadv_hard_iface *if_outgoing ) { struct batadv_priv *bat_priv ; void *tmp ; uint16_t tvlv_len ; int tmp___0 ; __u16 tmp___1 ; int tmp___2 ; unsigned long tmp___3 ; { tmp = netdev_priv((struct net_device const *)if_incoming->soft_iface); bat_priv = (struct batadv_priv *)tmp; if ((unsigned int )batadv_ogm_packet->ttl <= 1U) { tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___0 & 1) { batadv_debug_log(bat_priv, "ttl exceeded\n"); } else { } return; } else { } if (! is_from_best_next_hop) { if ((int )is_single_hop_neigh) { batadv_ogm_packet->flags = (uint8_t )((unsigned int )batadv_ogm_packet->flags | 1U); } else { return; } } else { } tmp___1 = __fswab16((int )batadv_ogm_packet->tvlv_len); tvlv_len = tmp___1; batadv_ogm_packet->ttl = (uint8_t )((int )batadv_ogm_packet->ttl - 1); ether_addr_copy((u8 *)(& batadv_ogm_packet->prev_sender), (u8 const *)(& ethhdr->h_source)); batadv_ogm_packet->tq = batadv_hop_penalty((int )batadv_ogm_packet->tq, (struct batadv_priv const *)bat_priv); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___2 & 1) { batadv_debug_log(bat_priv, "Forwarding packet: tq: %i, ttl: %i\n", (int )batadv_ogm_packet->tq, (int )batadv_ogm_packet->ttl); } else { } batadv_ogm_packet->flags = (unsigned int )batadv_ogm_packet->flags & 253U; if ((int )is_single_hop_neigh) { batadv_ogm_packet->flags = (uint8_t )((unsigned int )batadv_ogm_packet->flags | 4U); } else { batadv_ogm_packet->flags = (unsigned int )batadv_ogm_packet->flags & 251U; } tmp___3 = batadv_iv_ogm_fwd_send_time(); batadv_iv_ogm_queue_add(bat_priv, (unsigned char *)batadv_ogm_packet, (int )((unsigned int )tvlv_len + 24U), if_incoming, if_outgoing, 0, tmp___3); return; } } static void batadv_iv_ogm_slide_own_bcast_window(struct batadv_hard_iface *hard_iface ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; unsigned long *word ; uint32_t i ; size_t word_index ; uint8_t *w ; int if_num ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___4 ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->orig_hash; i = 0U; goto ldv_50130; ldv_50129: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_50127; ldv_50126: spin_lock_bh(& orig_node->bat_iv.ogm_cnt_lock); word_index = (unsigned long )hard_iface->if_num; word = orig_node->bat_iv.bcast_own + word_index; batadv_bit_get_packet((void *)bat_priv, word, 1, 0); if_num = (int )hard_iface->if_num; w = orig_node->bat_iv.bcast_own_sum + (unsigned long )if_num; tmp___2 = bitmap_weight((unsigned long const *)word, 64); *w = (uint8_t )tmp___2; spin_unlock_bh(& orig_node->bat_iv.ogm_cnt_lock); _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___4 = (struct batadv_orig_node *)0; } orig_node = tmp___4; ldv_50127: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_50126; } else { } rcu_read_unlock(); i = i + 1U; ldv_50130: ; if (hash->size > i) { goto ldv_50129; } else { } return; } } static void batadv_iv_ogm_schedule(struct batadv_hard_iface *hard_iface ) { struct batadv_priv *bat_priv ; void *tmp ; unsigned char **ogm_buff ; struct batadv_ogm_packet *batadv_ogm_packet ; struct batadv_hard_iface *primary_if ; struct batadv_hard_iface *tmp_hard_iface ; int *ogm_buff_len ; uint32_t seqno ; uint16_t tvlv_len ; unsigned long send_time ; __u16 tmp___0 ; int tmp___1 ; __u32 tmp___2 ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp___3 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___4 ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; ogm_buff = & hard_iface->bat_iv.ogm_buff; ogm_buff_len = & hard_iface->bat_iv.ogm_buff_len; tvlv_len = 0U; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )hard_iface == (unsigned long )primary_if) { batadv_tt_local_commit_changes(bat_priv); tvlv_len = batadv_tvlv_container_ogm_append(bat_priv, ogm_buff, ogm_buff_len, 24); } else { } batadv_ogm_packet = (struct batadv_ogm_packet *)*ogm_buff; tmp___0 = __fswab16((int )tvlv_len); batadv_ogm_packet->tvlv_len = tmp___0; tmp___1 = atomic_read((atomic_t const *)(& hard_iface->bat_iv.ogm_seqno)); seqno = (unsigned int )tmp___1; tmp___2 = __fswab32(seqno); batadv_ogm_packet->seqno = tmp___2; atomic_inc(& hard_iface->bat_iv.ogm_seqno); batadv_iv_ogm_slide_own_bcast_window(hard_iface); send_time = batadv_iv_ogm_emit_send_time((struct batadv_priv const *)bat_priv); if ((unsigned long )hard_iface != (unsigned long )primary_if) { batadv_iv_ogm_queue_add(bat_priv, *ogm_buff, *ogm_buff_len, hard_iface, hard_iface, 1, send_time); goto out; } else { } rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; tmp_hard_iface = (struct batadv_hard_iface *)__mptr; goto ldv_50161; ldv_50160: ; if ((unsigned long )tmp_hard_iface->soft_iface != (unsigned long )hard_iface->soft_iface) { goto ldv_50159; } else { } batadv_iv_ogm_queue_add(bat_priv, *ogm_buff, *ogm_buff_len, hard_iface, tmp_hard_iface, 1, send_time); ldv_50159: __ptr___0 = tmp_hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; tmp_hard_iface = (struct batadv_hard_iface *)__mptr___0; ldv_50161: ; if ((unsigned long )(& tmp_hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50160; } else { } rcu_read_unlock(); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } static void batadv_iv_ogm_orig_update(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_orig_ifinfo *orig_ifinfo , struct ethhdr const *ethhdr , struct batadv_ogm_packet const *batadv_ogm_packet , struct batadv_hard_iface *if_incoming , struct batadv_hard_iface *if_outgoing , enum batadv_dup_status dup_status ) { struct batadv_neigh_ifinfo *neigh_ifinfo ; struct batadv_neigh_ifinfo *router_ifinfo ; struct batadv_neigh_node *neigh_node ; struct batadv_neigh_node *tmp_neigh_node ; struct batadv_neigh_node *router ; struct batadv_orig_node *orig_node_tmp ; int if_num ; uint8_t sum_orig ; uint8_t sum_neigh ; uint8_t *neigh_addr ; uint8_t tq_avg ; int tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_neigh_node *tmp___1 ; int __ret_warn_on ; long tmp___2 ; long tmp___3 ; int tmp___4 ; int tmp___5 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___6 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp___7 ; struct batadv_orig_node *orig_tmp ; int tmp___8 ; { neigh_ifinfo = (struct batadv_neigh_ifinfo *)0; router_ifinfo = (struct batadv_neigh_ifinfo *)0; neigh_node = (struct batadv_neigh_node *)0; tmp_neigh_node = (struct batadv_neigh_node *)0; router = (struct batadv_neigh_node *)0; tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp & 1) { batadv_debug_log(bat_priv, "update_originator(): Searching and updating originator entry of received packet\n"); } else { } rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& orig_node->neigh_list.first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_neigh_node *)__mptr; } else { tmp___1 = (struct batadv_neigh_node *)0; } tmp_neigh_node = tmp___1; goto ldv_50208; ldv_50207: neigh_addr = (uint8_t *)(& tmp_neigh_node->addr); tmp___4 = batadv_compare_eth((void const *)neigh_addr, (void const *)(& ethhdr->h_source)); if (tmp___4 != 0 && (unsigned long )tmp_neigh_node->if_incoming == (unsigned long )if_incoming) { tmp___5 = atomic_add_unless(& tmp_neigh_node->refcount, 1, 0); if (tmp___5 != 0) { __ret_warn_on = (unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0); tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { warn_slowpath_fmt("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/bat_iv_ogm.o.c.prepared", 1153, "too many matching neigh_nodes"); } else { } tmp___3 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___3 != 0L) { batadv_neigh_node_free_ref(neigh_node); } else { } neigh_node = tmp_neigh_node; goto ldv_50206; } else { } } else { } if ((unsigned int )dup_status != 0U) { goto ldv_50206; } else { } neigh_ifinfo = batadv_neigh_ifinfo_get(tmp_neigh_node, if_outgoing); if ((unsigned long )neigh_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto ldv_50206; } else { } spin_lock_bh(& tmp_neigh_node->ifinfo_lock); batadv_ring_buffer_set((uint8_t *)(& neigh_ifinfo->bat_iv.tq_recv), & neigh_ifinfo->bat_iv.tq_index, 0); tq_avg = batadv_ring_buffer_avg((uint8_t const *)(& neigh_ifinfo->bat_iv.tq_recv)); neigh_ifinfo->bat_iv.tq_avg = tq_avg; spin_unlock_bh(& tmp_neigh_node->ifinfo_lock); batadv_neigh_ifinfo_free_ref(neigh_ifinfo); neigh_ifinfo = (struct batadv_neigh_ifinfo *)0; ldv_50206: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_neigh_node->list.next)); tmp___6 = debug_lockdep_rcu_enabled(); if (tmp___6 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___7 = (struct batadv_neigh_node *)__mptr___0; } else { tmp___7 = (struct batadv_neigh_node *)0; } tmp_neigh_node = tmp___7; ldv_50208: ; if ((unsigned long )tmp_neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50207; } else { } if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { orig_tmp = batadv_iv_ogm_orig_get(bat_priv, (uint8_t const *)(& ethhdr->h_source)); if ((unsigned long )orig_tmp == (unsigned long )((struct batadv_orig_node *)0)) { goto unlock; } else { } neigh_node = batadv_iv_ogm_neigh_new(if_incoming, (uint8_t const *)(& ethhdr->h_source), orig_node, orig_tmp); batadv_orig_node_free_ref(orig_tmp); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto unlock; } else { } } else { tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___8 & 1) { batadv_debug_log(bat_priv, "Updating existing last-hop neighbor of originator\n"); } else { } } rcu_read_unlock(); neigh_ifinfo = batadv_neigh_ifinfo_new(neigh_node, if_outgoing); if ((unsigned long )neigh_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } neigh_node->last_seen = jiffies; spin_lock_bh(& neigh_node->ifinfo_lock); batadv_ring_buffer_set((uint8_t *)(& neigh_ifinfo->bat_iv.tq_recv), & neigh_ifinfo->bat_iv.tq_index, (int )batadv_ogm_packet->tq); tq_avg = batadv_ring_buffer_avg((uint8_t const *)(& neigh_ifinfo->bat_iv.tq_recv)); neigh_ifinfo->bat_iv.tq_avg = tq_avg; spin_unlock_bh(& neigh_node->ifinfo_lock); if ((unsigned int )dup_status == 0U) { orig_ifinfo->last_ttl = batadv_ogm_packet->ttl; neigh_ifinfo->last_ttl = batadv_ogm_packet->ttl; } else { } router = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)if_outgoing); if ((unsigned long )router == (unsigned long )neigh_node) { goto out; } else { } if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { router_ifinfo = batadv_neigh_ifinfo_get(router, if_outgoing); if ((unsigned long )router_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } if ((int )router_ifinfo->bat_iv.tq_avg > (int )neigh_ifinfo->bat_iv.tq_avg) { goto out; } else { } } else { } if ((unsigned long )router_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0) && (int )neigh_ifinfo->bat_iv.tq_avg == (int )router_ifinfo->bat_iv.tq_avg) { orig_node_tmp = router->orig_node; spin_lock_bh(& orig_node_tmp->bat_iv.ogm_cnt_lock); if_num = (int )(router->if_incoming)->if_num; sum_orig = *(orig_node_tmp->bat_iv.bcast_own_sum + (unsigned long )if_num); spin_unlock_bh(& orig_node_tmp->bat_iv.ogm_cnt_lock); orig_node_tmp = neigh_node->orig_node; spin_lock_bh(& orig_node_tmp->bat_iv.ogm_cnt_lock); if_num = (int )(neigh_node->if_incoming)->if_num; sum_neigh = *(orig_node_tmp->bat_iv.bcast_own_sum + (unsigned long )if_num); spin_unlock_bh(& orig_node_tmp->bat_iv.ogm_cnt_lock); if ((int )sum_orig >= (int )sum_neigh) { goto out; } else { } } else { } batadv_update_route(bat_priv, orig_node, if_outgoing, neigh_node); goto out; unlock: rcu_read_unlock(); out: ; if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(neigh_node); } else { } if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router); } else { } if ((unsigned long )neigh_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(neigh_ifinfo); } else { } if ((unsigned long )router_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_ifinfo); } else { } return; } } static int batadv_iv_ogm_calc_tq(struct batadv_orig_node *orig_node , struct batadv_orig_node *orig_neigh_node , struct batadv_ogm_packet *batadv_ogm_packet , struct batadv_hard_iface *if_incoming , struct batadv_hard_iface *if_outgoing ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_neigh_node *neigh_node ; struct batadv_neigh_node *tmp_neigh_node ; struct batadv_neigh_ifinfo *neigh_ifinfo ; uint8_t total_count ; uint8_t orig_eq_count ; uint8_t neigh_rq_count ; uint8_t neigh_rq_inv ; uint8_t tq_own ; unsigned int neigh_rq_inv_cube ; unsigned int neigh_rq_max_cube ; int tq_asym_penalty ; int inv_asym_penalty ; int if_num ; int ret ; unsigned int combined_tq ; int tq_iface_penalty ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_neigh_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp___5 ; uint8_t tmp___6 ; bool tmp___7 ; int tmp___8 ; { tmp = netdev_priv((struct net_device const *)if_incoming->soft_iface); bat_priv = (struct batadv_priv *)tmp; neigh_node = (struct batadv_neigh_node *)0; ret = 0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& orig_neigh_node->neigh_list.first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_neigh_node *)__mptr; } else { tmp___1 = (struct batadv_neigh_node *)0; } tmp_neigh_node = tmp___1; goto ldv_50260; ldv_50259: tmp___2 = batadv_compare_eth((void const *)(& tmp_neigh_node->addr), (void const *)(& orig_neigh_node->orig)); if (tmp___2 == 0) { goto ldv_50257; } else { } if ((unsigned long )tmp_neigh_node->if_incoming != (unsigned long )if_incoming) { goto ldv_50257; } else { } tmp___3 = atomic_add_unless(& tmp_neigh_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_50257; } else { } neigh_node = tmp_neigh_node; goto ldv_50258; ldv_50257: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_neigh_node->list.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_neigh_node *)__mptr___0; } else { tmp___5 = (struct batadv_neigh_node *)0; } tmp_neigh_node = tmp___5; ldv_50260: ; if ((unsigned long )tmp_neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50259; } else { } ldv_50258: rcu_read_unlock(); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { neigh_node = batadv_iv_ogm_neigh_new(if_incoming, (uint8_t const *)(& orig_neigh_node->orig), orig_neigh_node, orig_neigh_node); } else { } if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } if ((unsigned long )orig_node == (unsigned long )orig_neigh_node) { neigh_node->last_seen = jiffies; } else { } orig_node->last_seen = jiffies; spin_lock_bh(& orig_node->bat_iv.ogm_cnt_lock); if_num = (int )if_incoming->if_num; orig_eq_count = *(orig_neigh_node->bat_iv.bcast_own_sum + (unsigned long )if_num); neigh_ifinfo = batadv_neigh_ifinfo_new(neigh_node, if_outgoing); if ((unsigned long )neigh_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { neigh_rq_count = neigh_ifinfo->bat_iv.real_packet_count; batadv_neigh_ifinfo_free_ref(neigh_ifinfo); } else { neigh_rq_count = 0U; } spin_unlock_bh(& orig_node->bat_iv.ogm_cnt_lock); if ((int )orig_eq_count > (int )neigh_rq_count) { total_count = neigh_rq_count; } else { total_count = orig_eq_count; } if ((unsigned int )total_count == 0U || (unsigned int )neigh_rq_count == 0U) { tq_own = 0U; } else { tq_own = (uint8_t )(((int )total_count * 255) / (int )neigh_rq_count); } neigh_rq_inv = 64U - (unsigned int )neigh_rq_count; neigh_rq_inv_cube = (unsigned int )(((int )neigh_rq_inv * (int )neigh_rq_inv) * (int )neigh_rq_inv); neigh_rq_max_cube = 262144U; inv_asym_penalty = (int )(neigh_rq_inv_cube * 255U); inv_asym_penalty = (int )((unsigned int )inv_asym_penalty / neigh_rq_max_cube); tq_asym_penalty = 255 - inv_asym_penalty; tq_iface_penalty = 255; if ((unsigned long )if_outgoing != (unsigned long )((struct batadv_hard_iface *)0) && (unsigned long )if_incoming == (unsigned long )if_outgoing) { tmp___7 = batadv_is_wifi_netdev(if_outgoing->net_dev); if ((int )tmp___7) { tmp___6 = batadv_hop_penalty(255, (struct batadv_priv const *)bat_priv); tq_iface_penalty = (int )tmp___6; } else { } } else { } combined_tq = (unsigned int )((((int )batadv_ogm_packet->tq * (int )tq_own) * tq_asym_penalty) * tq_iface_penalty); combined_tq = combined_tq / 16581375U; batadv_ogm_packet->tq = (uint8_t )combined_tq; tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___8 & 1) { batadv_debug_log(bat_priv, "bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, iface_penalty: %3i, total tq: %3i, if_incoming = %s, if_outgoing = %s\n", (uint8_t *)(& orig_node->orig), (uint8_t *)(& orig_neigh_node->orig), (int )total_count, (int )neigh_rq_count, (int )tq_own, tq_asym_penalty, tq_iface_penalty, (int )batadv_ogm_packet->tq, (char *)(& (if_incoming->net_dev)->name), (unsigned long )if_outgoing != (unsigned long )((struct batadv_hard_iface *)0) ? (char *)(& (if_outgoing->net_dev)->name) : (char *)"DEFAULT"); } else { } if ((unsigned int )batadv_ogm_packet->tq != 0U) { ret = 1; } else { } out: ; if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(neigh_node); } else { } return (ret); } } static enum batadv_dup_status batadv_iv_ogm_update_seqnos(struct ethhdr const *ethhdr , struct batadv_ogm_packet const *batadv_ogm_packet , struct batadv_hard_iface const *if_incoming , struct batadv_hard_iface *if_outgoing ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_orig_node *orig_node ; struct batadv_orig_ifinfo *orig_ifinfo ; struct batadv_neigh_node *neigh_node ; struct batadv_neigh_ifinfo *neigh_ifinfo ; int is_dup ; int32_t seq_diff ; int need_update ; int set_mark ; enum batadv_dup_status ret ; uint32_t seqno ; __u32 tmp___0 ; uint8_t *neigh_addr ; uint8_t packet_count ; unsigned long *bitmap ; int __ret_warn_on ; long tmp___1 ; long tmp___2 ; int tmp___3 ; int tmp___4 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___5 ; struct hlist_node const *__mptr ; struct batadv_neigh_node *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___10 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp___11 ; int tmp___12 ; { tmp = netdev_priv((struct net_device const *)if_incoming->soft_iface); bat_priv = (struct batadv_priv *)tmp; orig_ifinfo = (struct batadv_orig_ifinfo *)0; need_update = 0; ret = 0; tmp___0 = __fswab32(batadv_ogm_packet->seqno); seqno = tmp___0; orig_node = batadv_iv_ogm_orig_get(bat_priv, (uint8_t const *)(& batadv_ogm_packet->orig)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return (0); } else { } orig_ifinfo = batadv_orig_ifinfo_new(orig_node, if_outgoing); __ret_warn_on = (unsigned long )orig_ifinfo == (unsigned long )((struct batadv_orig_ifinfo *)0); tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { warn_slowpath_null("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/bat_iv_ogm.o.c.prepared", 1453); } else { } tmp___2 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___2 != 0L) { batadv_orig_node_free_ref(orig_node); return (0); } else { } spin_lock_bh(& orig_node->bat_iv.ogm_cnt_lock); seq_diff = (int32_t )(seqno - orig_ifinfo->last_real_seqno); tmp___3 = hlist_empty((struct hlist_head const *)(& orig_node->neigh_list)); if (tmp___3 == 0) { tmp___4 = batadv_window_protected(bat_priv, seq_diff, & orig_ifinfo->batman_seqno_reset); if (tmp___4 != 0) { ret = 3; goto out; } else { } } else { } rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& orig_node->neigh_list.first)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___6 = (struct batadv_neigh_node *)__mptr; } else { tmp___6 = (struct batadv_neigh_node *)0; } neigh_node = tmp___6; goto ldv_50307; ldv_50306: neigh_ifinfo = batadv_neigh_ifinfo_new(neigh_node, if_outgoing); if ((unsigned long )neigh_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto ldv_50305; } else { } neigh_addr = (uint8_t *)(& neigh_node->addr); is_dup = batadv_test_bit((unsigned long const *)(& neigh_ifinfo->bat_iv.real_bits), orig_ifinfo->last_real_seqno, seqno); tmp___7 = batadv_compare_eth((void const *)neigh_addr, (void const *)(& ethhdr->h_source)); if (tmp___7 != 0 && (unsigned long )((struct batadv_hard_iface const *)neigh_node->if_incoming) == (unsigned long )if_incoming) { set_mark = 1; if (is_dup != 0) { ret = 2; } else { } } else { set_mark = 0; if (is_dup != 0 && (unsigned int )ret != 2U) { ret = 1; } else { } } bitmap = (unsigned long *)(& neigh_ifinfo->bat_iv.real_bits); tmp___8 = batadv_bit_get_packet((void *)bat_priv, bitmap, seq_diff, set_mark); need_update = tmp___8 | need_update; tmp___9 = bitmap_weight((unsigned long const *)bitmap, 64); packet_count = (uint8_t )tmp___9; neigh_ifinfo->bat_iv.real_packet_count = packet_count; batadv_neigh_ifinfo_free_ref(neigh_ifinfo); ldv_50305: _________p1___0 = *((struct hlist_node * volatile *)(& neigh_node->list.next)); tmp___10 = debug_lockdep_rcu_enabled(); if (tmp___10 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___11 = (struct batadv_neigh_node *)__mptr___0; } else { tmp___11 = (struct batadv_neigh_node *)0; } neigh_node = tmp___11; ldv_50307: ; if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50306; } else { } rcu_read_unlock(); if (need_update != 0) { tmp___12 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___12 & 1) { batadv_debug_log(bat_priv, "%s updating last_seqno: old %u, new %u\n", (unsigned long )if_outgoing != (unsigned long )((struct batadv_hard_iface *)0) ? (char *)(& (if_outgoing->net_dev)->name) : (char *)"DEFAULT", orig_ifinfo->last_real_seqno, seqno); } else { } orig_ifinfo->last_real_seqno = seqno; } else { } out: spin_unlock_bh(& orig_node->bat_iv.ogm_cnt_lock); batadv_orig_node_free_ref(orig_node); if ((unsigned long )orig_ifinfo != (unsigned long )((struct batadv_orig_ifinfo *)0)) { batadv_orig_ifinfo_free_ref(orig_ifinfo); } else { } return (ret); } } static void batadv_iv_ogm_process_per_outif(struct sk_buff const *skb , int ogm_offset , struct batadv_orig_node *orig_node , struct batadv_hard_iface *if_incoming , struct batadv_hard_iface *if_outgoing ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_neigh_node *router ; struct batadv_neigh_node *router_router ; struct batadv_orig_node *orig_neigh_node ; struct batadv_orig_ifinfo *orig_ifinfo ; struct batadv_neigh_node *orig_neigh_router ; struct batadv_neigh_ifinfo *router_ifinfo ; struct batadv_ogm_packet *ogm_packet ; enum batadv_dup_status dup_status ; bool is_from_best_next_hop ; bool is_single_hop_neigh ; bool sameseq ; bool similar_ttl ; struct sk_buff *skb_priv ; struct ethhdr *ethhdr ; uint8_t *prev_sender ; int is_bidirect ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; __u32 tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; { tmp = netdev_priv((struct net_device const *)if_incoming->soft_iface); bat_priv = (struct batadv_priv *)tmp; router = (struct batadv_neigh_node *)0; router_router = (struct batadv_neigh_node *)0; orig_neigh_router = (struct batadv_neigh_node *)0; router_ifinfo = (struct batadv_neigh_ifinfo *)0; is_from_best_next_hop = 0; is_single_hop_neigh = 0; skb_priv = ldv_skb_copy_35(skb, 32U); if ((unsigned long )skb_priv == (unsigned long )((struct sk_buff *)0)) { return; } else { } ethhdr = eth_hdr((struct sk_buff const *)skb_priv); ogm_packet = (struct batadv_ogm_packet *)skb_priv->data + (unsigned long )ogm_offset; dup_status = batadv_iv_ogm_update_seqnos((struct ethhdr const *)ethhdr, (struct batadv_ogm_packet const *)ogm_packet, (struct batadv_hard_iface const *)if_incoming, if_outgoing); tmp___0 = batadv_compare_eth((void const *)(& ethhdr->h_source), (void const *)(& ogm_packet->orig)); if (tmp___0 != 0) { is_single_hop_neigh = 1; } else { } if ((unsigned int )dup_status == 3U) { tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___1 & 1) { batadv_debug_log(bat_priv, "Drop packet: packet within seqno protection time (sender: %pM)\n", (unsigned char *)(& ethhdr->h_source)); } else { } goto out; } else { } if ((unsigned int )ogm_packet->tq == 0U) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___2 & 1) { batadv_debug_log(bat_priv, "Drop packet: originator packet with tq equal 0\n"); } else { } goto out; } else { } router = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)if_outgoing); if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { router_router = batadv_orig_router_get(router->orig_node, (struct batadv_hard_iface const *)if_outgoing); router_ifinfo = batadv_neigh_ifinfo_get(router, if_outgoing); } else { } if ((unsigned long )router_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0) && (unsigned int )router_ifinfo->bat_iv.tq_avg != 0U) { tmp___3 = batadv_compare_eth((void const *)(& router->addr), (void const *)(& ethhdr->h_source)); if (tmp___3 != 0) { is_from_best_next_hop = 1; } else { } } else { } prev_sender = (uint8_t *)(& ogm_packet->prev_sender); if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0) && (unsigned long )router_router != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___5 = batadv_compare_eth((void const *)(& router->addr), (void const *)prev_sender); if (tmp___5 != 0) { tmp___6 = batadv_compare_eth((void const *)(& ogm_packet->orig), (void const *)prev_sender); if (tmp___6 == 0) { tmp___7 = batadv_compare_eth((void const *)(& router->addr), (void const *)(& router_router->addr)); if (tmp___7 != 0) { tmp___4 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___4 & 1) { batadv_debug_log(bat_priv, "Drop packet: ignoring all rebroadcast packets that may make me loop (sender: %pM)\n", (unsigned char *)(& ethhdr->h_source)); } else { } goto out; } else { } } else { } } else { } } else { } if ((unsigned long )if_outgoing == (unsigned long )((struct batadv_hard_iface *)0)) { batadv_tvlv_ogm_receive(bat_priv, ogm_packet, orig_node); } else { } if ((int )is_single_hop_neigh) { orig_neigh_node = orig_node; } else { orig_neigh_node = batadv_iv_ogm_orig_get(bat_priv, (uint8_t const *)(& ethhdr->h_source)); } if ((unsigned long )orig_neigh_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } batadv_nc_update_nc_node(bat_priv, orig_node, orig_neigh_node, ogm_packet, (int )is_single_hop_neigh); orig_neigh_router = batadv_orig_router_get(orig_neigh_node, (struct batadv_hard_iface const *)if_outgoing); if (! is_single_hop_neigh && (unsigned long )orig_neigh_router == (unsigned long )((struct batadv_neigh_node *)0)) { tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___8 & 1) { batadv_debug_log(bat_priv, "Drop packet: OGM via unknown neighbor!\n"); } else { } goto out_neigh; } else { } is_bidirect = batadv_iv_ogm_calc_tq(orig_node, orig_neigh_node, ogm_packet, if_incoming, if_outgoing); orig_ifinfo = batadv_orig_ifinfo_new(orig_node, if_outgoing); if ((unsigned long )orig_ifinfo == (unsigned long )((struct batadv_orig_ifinfo *)0)) { goto out_neigh; } else { } tmp___9 = __fswab32(ogm_packet->seqno); sameseq = orig_ifinfo->last_real_seqno == tmp___9; similar_ttl = (int )orig_ifinfo->last_ttl + -3 <= (int )ogm_packet->ttl; if (is_bidirect != 0 && ((unsigned int )dup_status == 0U || ((int )sameseq && (int )similar_ttl))) { batadv_iv_ogm_orig_update(bat_priv, orig_node, orig_ifinfo, (struct ethhdr const *)ethhdr, (struct batadv_ogm_packet const *)ogm_packet, if_incoming, if_outgoing, dup_status); } else { } batadv_orig_ifinfo_free_ref(orig_ifinfo); if ((unsigned long )if_outgoing == (unsigned long )((struct batadv_hard_iface *)0)) { goto out_neigh; } else { } if ((int )is_single_hop_neigh) { if ((unsigned int )ogm_packet->ttl <= 2U && (unsigned long )if_incoming != (unsigned long )if_outgoing) { tmp___10 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___10 & 1) { batadv_debug_log(bat_priv, "Drop packet: OGM from secondary interface and wrong outgoing interface\n"); } else { } goto out_neigh; } else { } batadv_iv_ogm_forward(orig_node, (struct ethhdr const *)ethhdr, ogm_packet, (int )is_single_hop_neigh, (int )is_from_best_next_hop, if_incoming, if_outgoing); tmp___11 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___11 & 1) { batadv_debug_log(bat_priv, "Forwarding packet: rebroadcast neighbor packet with direct link flag\n"); } else { } goto out_neigh; } else { } if (is_bidirect == 0) { tmp___12 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___12 & 1) { batadv_debug_log(bat_priv, "Drop packet: not received via bidirectional link\n"); } else { } goto out_neigh; } else { } if ((unsigned int )dup_status == 2U) { tmp___13 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___13 & 1) { batadv_debug_log(bat_priv, "Drop packet: duplicate packet received\n"); } else { } goto out_neigh; } else { } tmp___14 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___14 & 1) { batadv_debug_log(bat_priv, "Forwarding packet: rebroadcast originator packet\n"); } else { } batadv_iv_ogm_forward(orig_node, (struct ethhdr const *)ethhdr, ogm_packet, (int )is_single_hop_neigh, (int )is_from_best_next_hop, if_incoming, if_outgoing); out_neigh: ; if ((unsigned long )orig_neigh_node != (unsigned long )((struct batadv_orig_node *)0) && ! is_single_hop_neigh) { batadv_orig_node_free_ref(orig_neigh_node); } else { } out: ; if ((unsigned long )router_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_ifinfo); } else { } if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router); } else { } if ((unsigned long )router_router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router_router); } else { } if ((unsigned long )orig_neigh_router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(orig_neigh_router); } else { } kfree_skb(skb_priv); return; } } static void batadv_iv_ogm_process(struct sk_buff const *skb , int ogm_offset , struct batadv_hard_iface *if_incoming ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_orig_node *orig_neigh_node ; struct batadv_orig_node *orig_node ; struct batadv_hard_iface *hard_iface ; struct batadv_ogm_packet *ogm_packet ; uint32_t if_incoming_seqno ; bool has_directlink_flag ; struct ethhdr *ethhdr ; bool is_my_oldorig ; bool is_my_addr ; bool is_my_orig ; int tmp___0 ; __u32 tmp___1 ; int tmp___2 ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___7 ; int tmp___8 ; unsigned long *word ; int offset ; int32_t bit_pos ; int16_t if_num ; uint8_t *weight ; __u32 tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; struct list_head *__ptr___1 ; struct list_head const *__mptr___1 ; struct list_head *_________p1___1 ; bool __warned___1 ; int tmp___15 ; struct list_head *__ptr___2 ; struct list_head const *__mptr___2 ; struct list_head *_________p1___2 ; bool __warned___2 ; int tmp___16 ; { tmp = netdev_priv((struct net_device const *)if_incoming->soft_iface); bat_priv = (struct batadv_priv *)tmp; is_my_oldorig = 0; is_my_addr = 0; is_my_orig = 0; ogm_packet = (struct batadv_ogm_packet *)skb->data + (unsigned long )ogm_offset; ethhdr = eth_hdr(skb); if ((unsigned int )ogm_packet->packet_type != 0U) { return; } else { } tmp___0 = atomic_read((atomic_t const *)(& if_incoming->bat_iv.ogm_seqno)); if_incoming_seqno = (uint32_t )tmp___0; if (((int )ogm_packet->flags & 4) != 0) { has_directlink_flag = 1; } else { has_directlink_flag = 0; } tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___2 & 1) { tmp___1 = __fswab32(ogm_packet->seqno); batadv_debug_log(bat_priv, "Received BATMAN packet via NB: %pM, IF: %s [%pM] (from OG: %pM, via prev OG: %pM, seqno %u, tq %d, TTL %d, V %d, IDF %d)\n", (unsigned char *)(& ethhdr->h_source), (char *)(& (if_incoming->net_dev)->name), (if_incoming->net_dev)->dev_addr, (uint8_t *)(& ogm_packet->orig), (uint8_t *)(& ogm_packet->prev_sender), tmp___1, (int )ogm_packet->tq, (int )ogm_packet->ttl, (int )ogm_packet->version, (int )has_directlink_flag); } else { } rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface *)__mptr; goto ldv_50367; ldv_50366: ; if ((int )((signed char )hard_iface->if_status) != 3) { goto ldv_50365; } else { } if ((unsigned long )hard_iface->soft_iface != (unsigned long )if_incoming->soft_iface) { goto ldv_50365; } else { } tmp___4 = batadv_compare_eth((void const *)(& ethhdr->h_source), (void const *)(hard_iface->net_dev)->dev_addr); if (tmp___4 != 0) { is_my_addr = 1; } else { } tmp___5 = batadv_compare_eth((void const *)(& ogm_packet->orig), (void const *)(hard_iface->net_dev)->dev_addr); if (tmp___5 != 0) { is_my_orig = 1; } else { } tmp___6 = batadv_compare_eth((void const *)(& ogm_packet->prev_sender), (void const *)(hard_iface->net_dev)->dev_addr); if (tmp___6 != 0) { is_my_oldorig = 1; } else { } ldv_50365: __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___7 = debug_lockdep_rcu_enabled(); if (tmp___7 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface *)__mptr___0; ldv_50367: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50366; } else { } rcu_read_unlock(); if ((int )is_my_addr) { tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___8 & 1) { batadv_debug_log(bat_priv, "Drop packet: received my own broadcast (sender: %pM)\n", (unsigned char *)(& ethhdr->h_source)); } else { } return; } else { } if ((int )is_my_orig) { orig_neigh_node = batadv_iv_ogm_orig_get(bat_priv, (uint8_t const *)(& ethhdr->h_source)); if ((unsigned long )orig_neigh_node == (unsigned long )((struct batadv_orig_node *)0)) { return; } else { } if ((int )has_directlink_flag) { tmp___11 = batadv_compare_eth((void const *)(if_incoming->net_dev)->dev_addr, (void const *)(& ogm_packet->orig)); if (tmp___11 != 0) { if_num = if_incoming->if_num; offset = (int )if_num; spin_lock_bh(& orig_neigh_node->bat_iv.ogm_cnt_lock); word = orig_neigh_node->bat_iv.bcast_own + (unsigned long )offset; bit_pos = (int32_t )(if_incoming_seqno - 2U); tmp___9 = __fswab32(ogm_packet->seqno); bit_pos = (int32_t )((unsigned int )bit_pos - tmp___9); batadv_set_bit(word, bit_pos); weight = orig_neigh_node->bat_iv.bcast_own_sum + (unsigned long )if_num; tmp___10 = bitmap_weight((unsigned long const *)word, 64); *weight = (uint8_t )tmp___10; spin_unlock_bh(& orig_neigh_node->bat_iv.ogm_cnt_lock); } else { } } else { } tmp___12 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___12 & 1) { batadv_debug_log(bat_priv, "Drop packet: originator packet from myself (via neighbor)\n"); } else { } batadv_orig_node_free_ref(orig_neigh_node); return; } else { } if ((int )is_my_oldorig) { tmp___13 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___13 & 1) { batadv_debug_log(bat_priv, "Drop packet: ignoring all rebroadcast echos (sender: %pM)\n", (unsigned char *)(& ethhdr->h_source)); } else { } return; } else { } if ((int )ogm_packet->flags & 1) { tmp___14 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___14 & 1) { batadv_debug_log(bat_priv, "Drop packet: ignoring all packets not forwarded from the best next hop (sender: %pM)\n", (unsigned char *)(& ethhdr->h_source)); } else { } return; } else { } orig_node = batadv_iv_ogm_orig_get(bat_priv, (uint8_t const *)(& ogm_packet->orig)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return; } else { } batadv_iv_ogm_process_per_outif(skb, ogm_offset, orig_node, if_incoming, (struct batadv_hard_iface *)0); rcu_read_lock(); __ptr___1 = batadv_hardif_list.next; _________p1___1 = *((struct list_head * volatile *)(& __ptr___1)); tmp___15 = debug_lockdep_rcu_enabled(); if (tmp___15 != 0 && ! __warned___1) { rcu_read_lock_held(); } else { } __mptr___1 = (struct list_head const *)_________p1___1; hard_iface = (struct batadv_hard_iface *)__mptr___1; goto ldv_50390; ldv_50389: ; if ((int )((signed char )hard_iface->if_status) != 3) { goto ldv_50388; } else { } if ((unsigned long )hard_iface->soft_iface != (unsigned long )bat_priv->soft_iface) { goto ldv_50388; } else { } batadv_iv_ogm_process_per_outif(skb, ogm_offset, orig_node, if_incoming, hard_iface); ldv_50388: __ptr___2 = hard_iface->list.next; _________p1___2 = *((struct list_head * volatile *)(& __ptr___2)); tmp___16 = debug_lockdep_rcu_enabled(); if (tmp___16 != 0 && ! __warned___2) { rcu_read_lock_held(); } else { } __mptr___2 = (struct list_head const *)_________p1___2; hard_iface = (struct batadv_hard_iface *)__mptr___2; ldv_50390: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50389; } else { } rcu_read_unlock(); batadv_orig_node_free_ref(orig_node); return; } } static int batadv_iv_ogm_receive(struct sk_buff *skb , struct batadv_hard_iface *if_incoming ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_ogm_packet *ogm_packet ; uint8_t *packet_pos ; int ogm_offset ; bool ret ; __u16 tmp___0 ; unsigned int tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)if_incoming->soft_iface); bat_priv = (struct batadv_priv *)tmp; ret = batadv_check_management_packet(skb, if_incoming, 24); if (! ret) { return (1); } else { } if ((unsigned long )(bat_priv->bat_algo_ops)->bat_ogm_emit != (unsigned long )(& batadv_iv_ogm_emit)) { return (1); } else { } batadv_add_counter(bat_priv, 9UL, 1UL); batadv_add_counter(bat_priv, 10UL, (size_t )(skb->len + 14U)); ogm_offset = 0; ogm_packet = (struct batadv_ogm_packet *)skb->data; goto ldv_50402; ldv_50401: batadv_iv_ogm_process((struct sk_buff const *)skb, ogm_offset, if_incoming); ogm_offset = (int )((unsigned int )ogm_offset + 24U); tmp___0 = __fswab16((int )ogm_packet->tvlv_len); ogm_offset = (int )tmp___0 + ogm_offset; packet_pos = skb->data + (unsigned long )ogm_offset; ogm_packet = (struct batadv_ogm_packet *)packet_pos; ldv_50402: tmp___1 = skb_headlen((struct sk_buff const *)skb); tmp___2 = batadv_iv_ogm_aggr_packet(ogm_offset, (int )tmp___1, (int )ogm_packet->tvlv_len); if (tmp___2 != 0) { goto ldv_50401; } else { } kfree_skb(skb); return (0); } } static void batadv_iv_ogm_orig_print_neigh(struct batadv_orig_node *orig_node , struct batadv_hard_iface *if_outgoing , struct seq_file *seq ) { struct batadv_neigh_node *neigh_node ; struct batadv_neigh_ifinfo *n_ifinfo ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_neigh_node *tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___1 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp___2 ; { _________p1 = *((struct hlist_node * volatile *)(& orig_node->neigh_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_neigh_node *)__mptr; } else { tmp___0 = (struct batadv_neigh_node *)0; } neigh_node = tmp___0; goto ldv_50433; ldv_50432: n_ifinfo = batadv_neigh_ifinfo_get(neigh_node, if_outgoing); if ((unsigned long )n_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto ldv_50431; } else { } seq_printf(seq, " %pM (%3i)", (uint8_t *)(& neigh_node->addr), (int )n_ifinfo->bat_iv.tq_avg); batadv_neigh_ifinfo_free_ref(n_ifinfo); ldv_50431: _________p1___0 = *((struct hlist_node * volatile *)(& neigh_node->list.next)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_neigh_node *)__mptr___0; } else { tmp___2 = (struct batadv_neigh_node *)0; } neigh_node = tmp___2; ldv_50433: ; if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50432; } else { } return; } } static void batadv_iv_ogm_orig_print(struct batadv_priv *bat_priv , struct seq_file *seq , struct batadv_hard_iface *if_outgoing ) { struct batadv_neigh_node *neigh_node ; struct batadv_hashtable *hash ; int last_seen_msecs ; int last_seen_secs ; struct batadv_orig_node *orig_node ; struct batadv_neigh_ifinfo *n_ifinfo ; unsigned long last_seen_jiffies ; struct hlist_head *head ; int batman_count ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___0 ; unsigned int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___3 ; { hash = bat_priv->orig_hash; batman_count = 0; seq_printf(seq, " %-15s %s (%s/%i) %17s [%10s]: %20s ...\n", (char *)"Originator", (char *)"last-seen", (char *)"#", 255, (char *)"Nexthop", (char *)"outgoingIF", (char *)"Potential nexthops"); i = 0U; goto ldv_50476; ldv_50475: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___0 = (struct batadv_orig_node *)0; } orig_node = tmp___0; goto ldv_50473; ldv_50472: neigh_node = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)if_outgoing); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50470; } else { } n_ifinfo = batadv_neigh_ifinfo_get(neigh_node, if_outgoing); if ((unsigned long )n_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto next; } else { } if ((unsigned int )n_ifinfo->bat_iv.tq_avg == 0U) { goto next; } else { } last_seen_jiffies = (unsigned long )jiffies - orig_node->last_seen; tmp___1 = jiffies_to_msecs(last_seen_jiffies); last_seen_msecs = (int )tmp___1; last_seen_secs = last_seen_msecs / 1000; last_seen_msecs = last_seen_msecs % 1000; seq_printf(seq, "%pM %4i.%03is (%3i) %pM [%10s]:", (uint8_t *)(& orig_node->orig), last_seen_secs, last_seen_msecs, (int )n_ifinfo->bat_iv.tq_avg, (uint8_t *)(& neigh_node->addr), (char *)(& ((neigh_node->if_incoming)->net_dev)->name)); batadv_iv_ogm_orig_print_neigh(orig_node, if_outgoing, seq); seq_puts(seq, "\n"); batman_count = batman_count + 1; next: batadv_neigh_node_free_ref(neigh_node); if ((unsigned long )n_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(n_ifinfo); } else { } ldv_50470: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___3 = (struct batadv_orig_node *)0; } orig_node = tmp___3; ldv_50473: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_50472; } else { } rcu_read_unlock(); i = i + 1U; ldv_50476: ; if (hash->size > i) { goto ldv_50475; } else { } if (batman_count == 0) { seq_puts(seq, "No batman nodes in range ...\n"); } else { } return; } } static int batadv_iv_ogm_neigh_cmp(struct batadv_neigh_node *neigh1 , struct batadv_hard_iface *if_outgoing1 , struct batadv_neigh_node *neigh2 , struct batadv_hard_iface *if_outgoing2 ) { struct batadv_neigh_ifinfo *neigh1_ifinfo ; struct batadv_neigh_ifinfo *neigh2_ifinfo ; uint8_t tq1 ; uint8_t tq2 ; int diff ; { neigh1_ifinfo = batadv_neigh_ifinfo_get(neigh1, if_outgoing1); neigh2_ifinfo = batadv_neigh_ifinfo_get(neigh2, if_outgoing2); if ((unsigned long )neigh1_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0) || (unsigned long )neigh2_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { diff = 0; goto out; } else { } tq1 = neigh1_ifinfo->bat_iv.tq_avg; tq2 = neigh2_ifinfo->bat_iv.tq_avg; diff = (int )tq1 - (int )tq2; out: ; if ((unsigned long )neigh1_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(neigh1_ifinfo); } else { } if ((unsigned long )neigh2_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(neigh2_ifinfo); } else { } return (diff); } } static bool batadv_iv_ogm_neigh_is_eob(struct batadv_neigh_node *neigh1 , struct batadv_hard_iface *if_outgoing1 , struct batadv_neigh_node *neigh2 , struct batadv_hard_iface *if_outgoing2 ) { struct batadv_neigh_ifinfo *neigh1_ifinfo ; struct batadv_neigh_ifinfo *neigh2_ifinfo ; uint8_t tq1 ; uint8_t tq2 ; bool ret ; { neigh1_ifinfo = batadv_neigh_ifinfo_get(neigh1, if_outgoing1); neigh2_ifinfo = batadv_neigh_ifinfo_get(neigh2, if_outgoing2); if ((unsigned long )neigh1_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0) || (unsigned long )neigh2_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { ret = 0; goto out; } else { } tq1 = neigh1_ifinfo->bat_iv.tq_avg; tq2 = neigh2_ifinfo->bat_iv.tq_avg; ret = (int )tq1 - (int )tq2 >= -49; out: ; if ((unsigned long )neigh1_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(neigh1_ifinfo); } else { } if ((unsigned long )neigh2_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(neigh2_ifinfo); } else { } return (ret); } } static struct batadv_algo_ops batadv_batman_iv = {{0, 0}, (char *)"BATMAN_IV", & batadv_iv_ogm_iface_enable, & batadv_iv_ogm_iface_disable, & batadv_iv_ogm_iface_update_mac, & batadv_iv_ogm_primary_iface_set, & batadv_iv_ogm_schedule, & batadv_iv_ogm_emit, & batadv_iv_ogm_neigh_cmp, & batadv_iv_ogm_neigh_is_eob, & batadv_iv_ogm_orig_print, & batadv_iv_ogm_orig_free, & batadv_iv_ogm_orig_add_if, & batadv_iv_ogm_orig_del_if}; int batadv_iv_init(void) { int ret ; { ret = batadv_recv_handler_register(0, & batadv_iv_ogm_receive); if (ret < 0) { goto out; } else { } ret = batadv_algo_register(& batadv_batman_iv); if (ret < 0) { goto handler_unregister; } else { } goto out; handler_unregister: batadv_recv_handler_unregister(0); out: ; return (ret); } } void ldv_initialize_batadv_algo_ops_36(void) { void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; { tmp = ldv_zalloc(152UL); batadv_batman_iv_group0 = (struct batadv_neigh_node *)tmp; tmp___0 = ldv_zalloc(240UL); batadv_batman_iv_group2 = (struct batadv_hard_iface *)tmp___0; tmp___1 = ldv_zalloc(1616UL); batadv_batman_iv_group1 = (struct batadv_orig_node *)tmp___1; tmp___2 = ldv_zalloc(240UL); batadv_batman_iv_group4 = (struct batadv_hard_iface *)tmp___2; tmp___3 = ldv_zalloc(152UL); batadv_batman_iv_group3 = (struct batadv_neigh_node *)tmp___3; return; } } void ldv_main_exported_36(void) { int ldvarg115 ; int tmp ; struct batadv_forw_packet *ldvarg118 ; void *tmp___0 ; int ldvarg114 ; int tmp___1 ; struct seq_file *ldvarg117 ; void *tmp___2 ; int ldvarg113 ; int tmp___3 ; struct batadv_priv *ldvarg116 ; void *tmp___4 ; int tmp___5 ; { tmp = __VERIFIER_nondet_int(); ldvarg115 = tmp; tmp___0 = ldv_zalloc(296UL); ldvarg118 = (struct batadv_forw_packet *)tmp___0; tmp___1 = __VERIFIER_nondet_int(); ldvarg114 = tmp___1; tmp___2 = ldv_zalloc(264UL); ldvarg117 = (struct seq_file *)tmp___2; tmp___3 = __VERIFIER_nondet_int(); ldvarg113 = tmp___3; tmp___4 = ldv_zalloc(3200UL); ldvarg116 = (struct batadv_priv *)tmp___4; tmp___5 = __VERIFIER_nondet_int(); switch (tmp___5) { case 0: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_primary_iface_set(batadv_batman_iv_group2); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 1: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_emit(ldvarg118); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 2: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_orig_free(batadv_batman_iv_group1); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 3: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_iface_disable(batadv_batman_iv_group2); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 4: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_neigh_is_eob(batadv_batman_iv_group0, batadv_batman_iv_group2, batadv_batman_iv_group3, batadv_batman_iv_group4); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 5: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_orig_print(ldvarg116, ldvarg117, batadv_batman_iv_group2); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 6: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_schedule(batadv_batman_iv_group2); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 7: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_orig_add_if(batadv_batman_iv_group1, ldvarg115); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 8: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_orig_del_if(batadv_batman_iv_group1, ldvarg114, ldvarg113); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 9: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_iface_enable(batadv_batman_iv_group2); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 10: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_neigh_cmp(batadv_batman_iv_group0, batadv_batman_iv_group2, batadv_batman_iv_group3, batadv_batman_iv_group4); ldv_state_variable_36 = 1; } else { } goto ldv_50522; case 11: ; if (ldv_state_variable_36 == 1) { batadv_iv_ogm_iface_update_mac(batadv_batman_iv_group2); ldv_state_variable_36 = 1; } else { } goto ldv_50522; default: ldv_stop(); } ldv_50522: ; return; } } __inline static void spin_lock_bh(spinlock_t *lock ) { { ldv_spin_lock(); ldv_spin_lock_bh_2(lock); return; } } __inline static void spin_unlock_bh(spinlock_t *lock ) { { ldv_spin_unlock(); ldv_spin_unlock_bh_6(lock); return; } } __inline static void *kmalloc(size_t size , gfp_t flags ) { { ldv_check_alloc_flags(flags); ldv_kmalloc_12(size, flags); return ((void *)0); } } void *ldv_kmem_cache_alloc_16(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void *kzalloc(size_t size , gfp_t flags ) { { ldv_check_alloc_flags(flags); return ((void *)0); } } int ldv_pskb_expand_head_22(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_24(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_26(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_27(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_28(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_29(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_30(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_31(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_32(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_33(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } struct sk_buff *ldv_skb_clone_34(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_35(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } extern void *memset(void * , int , size_t ) ; extern void __bitmap_shift_left(unsigned long * , unsigned long const * , int , int ) ; __inline static void bitmap_zero(unsigned long *dst , int nbits ) { int len ; { len = (int )((unsigned int )(((unsigned long )nbits + 63UL) / 64UL) * 8U); memset((void *)dst, 0, (size_t )len); return; } } __inline static void bitmap_shift_left(unsigned long *dst , unsigned long const *src , int n , int nbits ) { { __bitmap_shift_left(dst, src, n, nbits); return; } } void *ldv_kmem_cache_alloc_64(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_81(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_72(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_80(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_74(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_70(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_78(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_79(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_75(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_76(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_77(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; static void batadv_bitmap_shift_left(unsigned long *seq_bits , int32_t n ) { { if (n <= 0 || n > 63) { return; } else { } bitmap_shift_left(seq_bits, (unsigned long const *)seq_bits, n, 64); return; } } int batadv_bit_get_packet(void *priv , unsigned long *seq_bits , int32_t seq_num_diff , int set_mark ) { struct batadv_priv *bat_priv ; int tmp ; int tmp___0 ; { bat_priv = (struct batadv_priv *)priv; if (seq_num_diff <= 0 && seq_num_diff >= -63) { if (set_mark != 0) { batadv_set_bit(seq_bits, - seq_num_diff); } else { } return (0); } else { } if (seq_num_diff > 0 && seq_num_diff <= 63) { batadv_bitmap_shift_left(seq_bits, seq_num_diff); if (set_mark != 0) { batadv_set_bit(seq_bits, 0); } else { } return (1); } else { } if (seq_num_diff > 63 && seq_num_diff <= 65535) { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp & 1) { batadv_debug_log(bat_priv, "We missed a lot of packets (%i) !\n", seq_num_diff + -1); } else { } bitmap_zero(seq_bits, 64); if (set_mark != 0) { batadv_set_bit(seq_bits, 0); } else { } return (1); } else { } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___0 & 1) { batadv_debug_log(bat_priv, "Other host probably restarted!\n"); } else { } bitmap_zero(seq_bits, 64); if (set_mark != 0) { batadv_set_bit(seq_bits, 0); } else { } return (1); } } void *ldv_kmem_cache_alloc_64(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_70(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_72(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_74(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_75(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_76(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_77(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_78(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_79(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_80(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_81(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void __hlist_del(struct hlist_node *n ) { struct hlist_node *next ; struct hlist_node **pprev ; { next = n->next; pprev = n->pprev; *pprev = next; if ((unsigned long )next != (unsigned long )((struct hlist_node *)0)) { next->pprev = pprev; } else { } return; } } extern void *__memcpy(void * , void const * , size_t ) ; extern void *memmove(void * , void const * , size_t ) ; extern int memcmp(void const * , void const * , size_t ) ; __inline static void atomic_dec(atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decl %0": "+m" (v->counter)); return; } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; extern bool cancel_delayed_work_sync(struct delayed_work * ) ; extern void kfree_call_rcu(struct callback_head * , void (*)(struct callback_head * ) ) ; void *ldv_kmem_cache_alloc_108(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_125(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static void hlist_del_rcu(struct hlist_node *n ) { { __hlist_del(n); n->pprev = (struct hlist_node **)-2401263026316508672L; return; } } struct sk_buff *ldv_skb_clone_116(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_124(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_118(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_114(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_122(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_123(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; __inline static unsigned char *skb_end_pointer(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->end); } } __inline static int skb_header_cloned(struct sk_buff const *skb ) { int dataref ; unsigned char *tmp ; { if ((unsigned int )*((unsigned char *)skb + 124UL) == 0U) { return (0); } else { } tmp = skb_end_pointer(skb); dataref = atomic_read((atomic_t const *)(& ((struct skb_shared_info *)tmp)->dataref)); dataref = (dataref & 65535) - (dataref >> 16); return (dataref != 1); } } extern unsigned char *skb_push(struct sk_buff * , unsigned int ) ; extern unsigned char *__pskb_pull_tail(struct sk_buff * , int ) ; __inline static int pskb_may_pull(struct sk_buff *skb , unsigned int len ) { unsigned int tmp ; long tmp___0 ; long tmp___1 ; unsigned int tmp___2 ; unsigned char *tmp___3 ; { tmp = skb_headlen((struct sk_buff const *)skb); tmp___0 = ldv__builtin_expect(tmp >= len, 1L); if (tmp___0 != 0L) { return (1); } else { } tmp___1 = ldv__builtin_expect(skb->len < len, 0L); if (tmp___1 != 0L) { return (0); } else { } tmp___2 = skb_headlen((struct sk_buff const *)skb); tmp___3 = __pskb_pull_tail(skb, (int )(len - tmp___2)); return ((unsigned long )tmp___3 != (unsigned long )((unsigned char *)0U)); } } __inline static unsigned int skb_headroom(struct sk_buff const *skb ) { { return ((unsigned int )((long )skb->data) - (unsigned int )((long )skb->head)); } } __inline static void skb_reset_mac_header(struct sk_buff *skb ) { { skb->mac_header = (int )((__u16 )((long )skb->data)) - (int )((__u16 )((long )skb->head)); return; } } struct sk_buff *ldv___netdev_alloc_skb_119(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_120(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_121(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static int __skb_cow(struct sk_buff *skb , unsigned int headroom , int cloned ) { int delta ; unsigned int tmp ; unsigned int tmp___0 ; int _max1 ; int _max2 ; int _max1___0 ; int _max2___0 ; int tmp___1 ; { delta = 0; tmp___0 = skb_headroom((struct sk_buff const *)skb); if (tmp___0 < headroom) { tmp = skb_headroom((struct sk_buff const *)skb); delta = (int )(headroom - tmp); } else { } if (delta != 0 || cloned != 0) { _max1 = 32; _max2 = 64; _max1___0 = 32; _max2___0 = 64; tmp___1 = ldv_pskb_expand_head_122(skb, (((_max1 > _max2 ? _max1 : _max2) + -1) + delta) & - (_max1___0 > _max2___0 ? _max1___0 : _max2___0), 0, 32U); return (tmp___1); } else { } return (0); } } __inline static int skb_cow_head(struct sk_buff *skb , unsigned int headroom ) { int tmp ; int tmp___0 ; { tmp = skb_header_cloned((struct sk_buff const *)skb); tmp___0 = __skb_cow(skb, headroom, tmp); return (tmp___0); } } extern void __dev_kfree_skb_any(struct sk_buff * , enum skb_free_reason ) ; __inline static void dev_kfree_skb_any(struct sk_buff *skb ) { { __dev_kfree_skb_any(skb, 1); return; } } extern int netif_rx(struct sk_buff * ) ; extern __be16 eth_type_trans(struct sk_buff * , struct net_device * ) ; __inline static bool is_multicast_ether_addr(u8 const *addr ) { { return (((int )*addr & 1) != 0); } } __inline static int arp_hdr_len(struct net_device *dev ) { { switch ((int )dev->type) { case 24: ; return ((int )((unsigned int )dev->addr_len + 16U)); default: ; return ((int )((unsigned int )((unsigned long )dev->addr_len + 8UL) * 2U)); } } } __inline static struct vlan_ethhdr *vlan_eth_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_mac_header(skb); return ((struct vlan_ethhdr *)tmp); } } __inline static struct sk_buff *vlan_insert_tag(struct sk_buff *skb , __be16 vlan_proto , u16 vlan_tci ) { struct vlan_ethhdr *veth ; int tmp ; unsigned char *tmp___0 ; __u16 tmp___1 ; { tmp = skb_cow_head(skb, 4U); if (tmp < 0) { dev_kfree_skb_any(skb); return ((struct sk_buff *)0); } else { } tmp___0 = skb_push(skb, 4U); veth = (struct vlan_ethhdr *)tmp___0; memmove((void *)skb->data, (void const *)skb->data + 4U, 12UL); skb->mac_header = (unsigned int )skb->mac_header + 65532U; veth->h_vlan_proto = vlan_proto; tmp___1 = __fswab16((int )vlan_tci); veth->h_vlan_TCI = tmp___1; return (skb); } } struct batadv_hard_iface *batadv_seq_print_text_primary_if_get(struct seq_file *seq ) ; __be32 batadv_skb_crc32(struct sk_buff *skb , u8 *payload_ptr ) ; __inline static bool batadv_has_timed_out(unsigned long timestamp , unsigned int timeout ) { unsigned long tmp ; { tmp = msecs_to_jiffies(timeout); return ((bool )((long )((tmp + timestamp) - (unsigned long )jiffies) < 0L)); } } __inline static void batadv_add_counter___0(struct batadv_priv *bat_priv , size_t idx , size_t count ) { void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; { __vpp_verify = (void const *)0; switch (8UL) { case 1UL: pao_ID__ = 0; switch (8UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49247; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49247; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49247; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49247; default: __bad_percpu_size(); } ldv_49247: ; goto ldv_49252; case 2UL: pao_ID_____0 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49258; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49258; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49258; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49258; default: __bad_percpu_size(); } ldv_49258: ; goto ldv_49252; case 4UL: pao_ID_____1 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49268; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49268; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49268; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49268; default: __bad_percpu_size(); } ldv_49268: ; goto ldv_49252; case 8UL: pao_ID_____2 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49278; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49278; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49278; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49278; default: __bad_percpu_size(); } ldv_49278: ; goto ldv_49252; default: __bad_size_call_parameter(); goto ldv_49252; } ldv_49252: ; return; } } unsigned short batadv_get_vid(struct sk_buff *skb , size_t header_len ) ; struct batadv_hashtable *batadv_hash_new(uint32_t size ) ; void batadv_hash_set_lock_class(struct batadv_hashtable *hash , struct lock_class_key *key ) ; void batadv_hash_destroy(struct batadv_hashtable *hash ) ; __inline static uint32_t batadv_hash_bytes(uint32_t hash , void const *data , uint32_t size ) { unsigned char const *key ; int i ; { key = (unsigned char const *)data; i = 0; goto ldv_49404; ldv_49403: hash = (uint32_t )*(key + (unsigned long )i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1; ldv_49404: ; if ((uint32_t )i < size) { goto ldv_49403; } else { } return (hash); } } __inline static int batadv_hash_add___0(struct batadv_hashtable *hash , int (*compare)(struct hlist_node const * , void const * ) , uint32_t (*choose)(void const * , uint32_t ) , void const *data , struct hlist_node *data_node ) { uint32_t index ; int ret ; struct hlist_head *head ; struct hlist_node *node ; spinlock_t *list_lock ; int tmp ; { ret = -1; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { goto out; } else { } index = (*choose)(data, hash->size); head = hash->table + (unsigned long )index; list_lock = hash->list_locks + (unsigned long )index; spin_lock_bh(list_lock); node = head->first; goto ldv_49422; ldv_49421: tmp = (*compare)((struct hlist_node const *)node, data); if (tmp == 0) { goto ldv_49419; } else { } ret = 1; goto unlock; ldv_49419: node = node->next; ldv_49422: ; if ((unsigned long )node != (unsigned long )((struct hlist_node *)0)) { goto ldv_49421; } else { } hlist_add_head_rcu(data_node, head); ret = 0; unlock: spin_unlock_bh(list_lock); out: ; return (ret); } } __inline static void *batadv_hash_remove(struct batadv_hashtable *hash , int (*compare)(struct hlist_node const * , void const * ) , uint32_t (*choose)(void const * , uint32_t ) , void *data ) { uint32_t index ; struct hlist_node *node ; struct hlist_head *head ; void *data_save ; int tmp ; { data_save = (void *)0; index = (*choose)((void const *)data, hash->size); head = hash->table + (unsigned long )index; spin_lock_bh(hash->list_locks + (unsigned long )index); node = head->first; goto ldv_49437; ldv_49436: tmp = (*compare)((struct hlist_node const *)node, (void const *)data); if (tmp == 0) { goto ldv_49434; } else { } data_save = (void *)node; hlist_del_rcu(node); goto ldv_49435; ldv_49434: node = node->next; ldv_49437: ; if ((unsigned long )node != (unsigned long )((struct hlist_node *)0)) { goto ldv_49436; } else { } ldv_49435: spin_unlock_bh(hash->list_locks + (unsigned long )index); return (data_save); } } __inline static uint32_t batadv_choose_orig___0(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49556; ldv_49555: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49556: ; if (i <= 5UL) { goto ldv_49555; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find___0(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig___0(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_49590; ldv_49589: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_49587; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49587; } else { } orig_node_tmp = orig_node; goto ldv_49588; ldv_49587: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_49590: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49589; } else { } ldv_49588: rcu_read_unlock(); return (orig_node_tmp); } } int batadv_bla_rx(struct batadv_priv *bat_priv , struct sk_buff *skb , unsigned short vid , bool is_bcast ) ; int batadv_bla_tx(struct batadv_priv *bat_priv , struct sk_buff *skb , unsigned short vid ) ; int batadv_bla_is_backbone_gw(struct sk_buff *skb , struct batadv_orig_node *orig_node , int hdr_size ) ; int batadv_bla_claim_table_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq , void *offset ) ; bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv , uint8_t *orig , unsigned short vid ) ; int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv , struct sk_buff *skb ) ; void batadv_bla_update_orig_address(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , struct batadv_hard_iface *oldif ) ; int batadv_bla_init(struct batadv_priv *bat_priv ) ; void batadv_bla_free(struct batadv_priv *bat_priv ) ; void batadv_tt_global_del_orig(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , int32_t match_vid , char const *message ) ; extern u16 crc16(u16 , u8 const * , size_t ) ; extern struct sk_buff *arp_create(int , int , __be32 , struct net_device * , __be32 , unsigned char const * , unsigned char const * , unsigned char const * ) ; static uint8_t const batadv_announce_mac[4U] = { 67U, 5U, 67U, 5U}; static void batadv_bla_periodic_work(struct work_struct *work ) ; static void batadv_bla_send_announce(struct batadv_priv *bat_priv , struct batadv_bla_backbone_gw *backbone_gw ) ; __inline static uint32_t batadv_choose_claim(void const *data , uint32_t size ) { struct batadv_bla_claim *claim ; uint32_t hash ; { claim = (struct batadv_bla_claim *)data; hash = 0U; hash = batadv_hash_bytes(hash, (void const *)(& claim->addr), 6U); hash = batadv_hash_bytes(hash, (void const *)(& claim->vid), 2U); hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static uint32_t batadv_choose_backbone_gw(void const *data , uint32_t size ) { struct batadv_bla_claim const *claim ; uint32_t hash ; { claim = (struct batadv_bla_claim const *)data; hash = 0U; hash = batadv_hash_bytes(hash, (void const *)(& claim->addr), 6U); hash = batadv_hash_bytes(hash, (void const *)(& claim->vid), 2U); hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } static int batadv_compare_backbone_gw(struct hlist_node const *node , void const *data2 ) { void const *data1 ; struct hlist_node const *__mptr ; struct batadv_bla_backbone_gw const *gw1 ; struct batadv_bla_backbone_gw const *gw2 ; int tmp ; { __mptr = node; data1 = (void const *)((struct batadv_bla_backbone_gw *)__mptr + 0xfffffffffffffff8UL); gw1 = (struct batadv_bla_backbone_gw const *)data1; gw2 = (struct batadv_bla_backbone_gw const *)data2; tmp = batadv_compare_eth((void const *)(& gw1->orig), (void const *)(& gw2->orig)); if (tmp == 0) { return (0); } else { } if ((int )((unsigned short )gw1->vid) != (int )((unsigned short )gw2->vid)) { return (0); } else { } return (1); } } static int batadv_compare_claim(struct hlist_node const *node , void const *data2 ) { void const *data1 ; struct hlist_node const *__mptr ; struct batadv_bla_claim const *cl1 ; struct batadv_bla_claim const *cl2 ; int tmp ; { __mptr = node; data1 = (void const *)((struct batadv_bla_claim *)__mptr + 0xffffffffffffffe8UL); cl1 = (struct batadv_bla_claim const *)data1; cl2 = (struct batadv_bla_claim const *)data2; tmp = batadv_compare_eth((void const *)(& cl1->addr), (void const *)(& cl2->addr)); if (tmp == 0) { return (0); } else { } if ((int )((unsigned short )cl1->vid) != (int )((unsigned short )cl2->vid)) { return (0); } else { } return (1); } } static void batadv_backbone_gw_free_ref(struct batadv_bla_backbone_gw *backbone_gw ) { int tmp ; { tmp = atomic_dec_and_test(& backbone_gw->refcount); if (tmp != 0) { kfree_call_rcu(& backbone_gw->rcu, (void (*)(struct callback_head * ))56); } else { } return; } } static void batadv_claim_free_rcu(struct callback_head *rcu ) { struct batadv_bla_claim *claim ; struct callback_head const *__mptr ; { __mptr = (struct callback_head const *)rcu; claim = (struct batadv_bla_claim *)__mptr + 0xffffffffffffffd8UL; batadv_backbone_gw_free_ref(claim->backbone_gw); kfree((void const *)claim); return; } } static void batadv_claim_free_ref(struct batadv_bla_claim *claim ) { int tmp ; { tmp = atomic_dec_and_test(& claim->refcount); if (tmp != 0) { call_rcu_sched(& claim->rcu, & batadv_claim_free_rcu); } else { } return; } } static struct batadv_bla_claim *batadv_claim_hash_find(struct batadv_priv *bat_priv , struct batadv_bla_claim *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_bla_claim *claim ; struct batadv_bla_claim *claim_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_bla_claim *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_claim *tmp___5 ; { hash = bat_priv->bla.claim_hash; claim_tmp = (struct batadv_bla_claim *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_bla_claim *)0); } else { } tmp = batadv_choose_claim((void const *)data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_bla_claim *)__mptr + 0xffffffffffffffe8UL; } else { tmp___1 = (struct batadv_bla_claim *)0; } claim = tmp___1; goto ldv_49903; ldv_49902: tmp___2 = batadv_compare_claim((struct hlist_node const *)(& claim->hash_entry), (void const *)data); if (tmp___2 == 0) { goto ldv_49900; } else { } tmp___3 = atomic_add_unless(& claim->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49900; } else { } claim_tmp = claim; goto ldv_49901; ldv_49900: _________p1___0 = *((struct hlist_node * volatile *)(& claim->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_bla_claim *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___5 = (struct batadv_bla_claim *)0; } claim = tmp___5; ldv_49903: ; if ((unsigned long )claim != (unsigned long )((struct batadv_bla_claim *)0)) { goto ldv_49902; } else { } ldv_49901: rcu_read_unlock(); return (claim_tmp); } } static struct batadv_bla_backbone_gw *batadv_backbone_hash_find(struct batadv_priv *bat_priv , uint8_t *addr , unsigned short vid ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_bla_backbone_gw search_entry ; struct batadv_bla_backbone_gw *backbone_gw ; struct batadv_bla_backbone_gw *backbone_gw_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_bla_backbone_gw *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_backbone_gw *tmp___5 ; { hash = bat_priv->bla.backbone_hash; backbone_gw_tmp = (struct batadv_bla_backbone_gw *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_bla_backbone_gw *)0); } else { } ether_addr_copy((u8 *)(& search_entry.orig), (u8 const *)addr); search_entry.vid = vid; tmp = batadv_choose_backbone_gw((void const *)(& search_entry), hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_bla_backbone_gw *)__mptr + 0xfffffffffffffff8UL; } else { tmp___1 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___1; goto ldv_49938; ldv_49937: tmp___2 = batadv_compare_backbone_gw((struct hlist_node const *)(& backbone_gw->hash_entry), (void const *)(& search_entry)); if (tmp___2 == 0) { goto ldv_49935; } else { } tmp___3 = atomic_add_unless(& backbone_gw->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49935; } else { } backbone_gw_tmp = backbone_gw; goto ldv_49936; ldv_49935: _________p1___0 = *((struct hlist_node * volatile *)(& backbone_gw->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_bla_backbone_gw *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___5 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___5; ldv_49938: ; if ((unsigned long )backbone_gw != (unsigned long )((struct batadv_bla_backbone_gw *)0)) { goto ldv_49937; } else { } ldv_49936: rcu_read_unlock(); return (backbone_gw_tmp); } } static void batadv_bla_del_backbone_claims(struct batadv_bla_backbone_gw *backbone_gw ) { struct batadv_hashtable *hash ; struct hlist_node *node_tmp ; struct hlist_head *head ; struct batadv_bla_claim *claim ; int i ; spinlock_t *list_lock ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_bla_claim *tmp ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_claim *tmp___0 ; { hash = (backbone_gw->bat_priv)->bla.claim_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0; goto ldv_49962; ldv_49961: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_bla_claim *)__mptr + 0xffffffffffffffe8UL; } else { tmp = (struct batadv_bla_claim *)0; } claim = tmp; goto ldv_49959; ldv_49958: ; if ((unsigned long )claim->backbone_gw != (unsigned long )backbone_gw) { goto ldv_49957; } else { } batadv_claim_free_ref(claim); hlist_del_rcu(& claim->hash_entry); ldv_49957: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_bla_claim *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___0 = (struct batadv_bla_claim *)0; } claim = tmp___0; ldv_49959: ; if ((unsigned long )claim != (unsigned long )((struct batadv_bla_claim *)0)) { node_tmp = claim->hash_entry.next; goto ldv_49958; } else { } spin_unlock_bh(list_lock); i = i + 1; ldv_49962: ; if ((uint32_t )i < hash->size) { goto ldv_49961; } else { } backbone_gw->crc = 0U; return; } } static void batadv_bla_send_claim(struct batadv_priv *bat_priv , uint8_t *mac , unsigned short vid , int claimtype ) { struct sk_buff *skb ; struct ethhdr *ethhdr ; struct batadv_hard_iface *primary_if ; struct net_device *soft_iface ; uint8_t *hw_src ; struct batadv_bla_claim_dst local_claim_dest ; __be32 zeroip ; size_t __len ; void *__ret ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { zeroip = 0U; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { return; } else { } __len = 6UL; if (__len > 63UL) { __ret = __memcpy((void *)(& local_claim_dest), (void const *)(& bat_priv->bla.claim_dest), __len); } else { __ret = __builtin_memcpy((void *)(& local_claim_dest), (void const *)(& bat_priv->bla.claim_dest), __len); } local_claim_dest.type = (uint8_t )claimtype; soft_iface = primary_if->soft_iface; skb = arp_create(2, 2054, zeroip, primary_if->soft_iface, zeroip, (unsigned char const *)0U, (unsigned char const *)(primary_if->net_dev)->dev_addr, (unsigned char const *)(& local_claim_dest)); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto out; } else { } ethhdr = (struct ethhdr *)skb->data; hw_src = (uint8_t *)ethhdr + 22U; switch (claimtype) { case 0: ether_addr_copy((u8 *)(& ethhdr->h_source), (u8 const *)mac); tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 8) != 0) { batadv_debug_log(bat_priv, "bla_send_claim(): CLAIM %pM on vid %d\n", mac, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } goto ldv_49982; case 1: ether_addr_copy(hw_src, (u8 const *)mac); tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 8) != 0) { batadv_debug_log(bat_priv, "bla_send_claim(): UNCLAIM %pM on vid %d\n", mac, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } goto ldv_49982; case 2: ether_addr_copy(hw_src, (u8 const *)mac); tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 8) != 0) { batadv_debug_log(bat_priv, "bla_send_claim(): ANNOUNCE of %pM on vid %d\n", (unsigned char *)(& ethhdr->h_source), (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } goto ldv_49982; case 3: ether_addr_copy(hw_src, (u8 const *)mac); ether_addr_copy((u8 *)(& ethhdr->h_dest), (u8 const *)mac); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 8) != 0) { batadv_debug_log(bat_priv, "bla_send_claim(): REQUEST of %pM to %pM on vid %d\n", (unsigned char *)(& ethhdr->h_source), (unsigned char *)(& ethhdr->h_dest), (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } goto ldv_49982; } ldv_49982: ; if ((int )((short )vid) < 0) { skb = vlan_insert_tag(skb, 129, (int )vid & 4095); } else { } skb_reset_mac_header(skb); skb->protocol = eth_type_trans(skb, soft_iface); batadv_add_counter___0(bat_priv, 3UL, 1UL); batadv_add_counter___0(bat_priv, 4UL, (size_t )(skb->len + 14U)); soft_iface->last_rx = jiffies; netif_rx(skb); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } static struct batadv_bla_backbone_gw *batadv_bla_get_backbone_gw(struct batadv_priv *bat_priv , uint8_t *orig , unsigned short vid , bool own_backbone ) { struct batadv_bla_backbone_gw *entry ; struct batadv_orig_node *orig_node ; int hash_added ; int tmp ; void *tmp___0 ; long tmp___1 ; { entry = batadv_backbone_hash_find(bat_priv, orig, (int )vid); if ((unsigned long )entry != (unsigned long )((struct batadv_bla_backbone_gw *)0)) { return (entry); } else { } tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 8) != 0) { batadv_debug_log(bat_priv, "bla_get_backbone_gw(): not found (%pM, %d), creating new entry\n", orig, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } tmp___0 = kzalloc(72UL, 32U); entry = (struct batadv_bla_backbone_gw *)tmp___0; if ((unsigned long )entry == (unsigned long )((struct batadv_bla_backbone_gw *)0)) { return ((struct batadv_bla_backbone_gw *)0); } else { } entry->vid = vid; entry->lasttime = jiffies; entry->crc = 0U; entry->bat_priv = bat_priv; atomic_set(& entry->request_sent, 0); atomic_set(& entry->wait_periods, 0); ether_addr_copy((u8 *)(& entry->orig), (u8 const *)orig); atomic_set(& entry->refcount, 2); hash_added = batadv_hash_add___0(bat_priv->bla.backbone_hash, & batadv_compare_backbone_gw, & batadv_choose_backbone_gw, (void const *)entry, & entry->hash_entry); tmp___1 = ldv__builtin_expect(hash_added != 0, 0L); if (tmp___1 != 0L) { kfree((void const *)entry); return ((struct batadv_bla_backbone_gw *)0); } else { } orig_node = batadv_orig_hash_find___0(bat_priv, (void const *)orig); if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_tt_global_del_orig(bat_priv, orig_node, (int32_t )vid, "became a backbone gateway"); batadv_orig_node_free_ref(orig_node); } else { } if ((int )own_backbone) { batadv_bla_send_announce(bat_priv, entry); atomic_inc(& entry->request_sent); atomic_set(& entry->wait_periods, 3); atomic_inc(& bat_priv->bla.num_requests); } else { } return (entry); } } static void batadv_bla_update_own_backbone_gw(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , unsigned short vid ) { struct batadv_bla_backbone_gw *backbone_gw ; long tmp ; { backbone_gw = batadv_bla_get_backbone_gw(bat_priv, (primary_if->net_dev)->dev_addr, (int )vid, 1); tmp = ldv__builtin_expect((unsigned long )backbone_gw == (unsigned long )((struct batadv_bla_backbone_gw *)0), 0L); if (tmp != 0L) { return; } else { } backbone_gw->lasttime = jiffies; batadv_backbone_gw_free_ref(backbone_gw); return; } } static void batadv_bla_answer_request(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , unsigned short vid ) { struct hlist_head *head ; struct batadv_hashtable *hash ; struct batadv_bla_claim *claim ; struct batadv_bla_backbone_gw *backbone_gw ; int i ; int tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_bla_claim *tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_claim *tmp___3 ; { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 8) != 0) { batadv_debug_log(bat_priv, "bla_answer_request(): received a claim request, send all of our own claims again\n"); } else { } backbone_gw = batadv_backbone_hash_find(bat_priv, (primary_if->net_dev)->dev_addr, (int )vid); if ((unsigned long )backbone_gw == (unsigned long )((struct batadv_bla_backbone_gw *)0)) { return; } else { } hash = bat_priv->bla.claim_hash; i = 0; goto ldv_50036; ldv_50035: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_bla_claim *)__mptr + 0xffffffffffffffe8UL; } else { tmp___1 = (struct batadv_bla_claim *)0; } claim = tmp___1; goto ldv_50033; ldv_50032: ; if ((unsigned long )claim->backbone_gw != (unsigned long )backbone_gw) { goto ldv_50031; } else { } batadv_bla_send_claim(bat_priv, (uint8_t *)(& claim->addr), (int )claim->vid, 0); ldv_50031: _________p1___0 = *((struct hlist_node * volatile *)(& claim->hash_entry.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_bla_claim *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___3 = (struct batadv_bla_claim *)0; } claim = tmp___3; ldv_50033: ; if ((unsigned long )claim != (unsigned long )((struct batadv_bla_claim *)0)) { goto ldv_50032; } else { } rcu_read_unlock(); i = i + 1; ldv_50036: ; if ((uint32_t )i < hash->size) { goto ldv_50035; } else { } batadv_bla_send_announce(bat_priv, backbone_gw); batadv_backbone_gw_free_ref(backbone_gw); return; } } static void batadv_bla_send_request(struct batadv_bla_backbone_gw *backbone_gw ) { int tmp ; int tmp___0 ; { batadv_bla_del_backbone_claims(backbone_gw); tmp = atomic_read((atomic_t const *)(& (backbone_gw->bat_priv)->log_level)); if ((tmp & 8) != 0) { batadv_debug_log(backbone_gw->bat_priv, "Sending REQUEST to %pM\n", (uint8_t *)(& backbone_gw->orig)); } else { } batadv_bla_send_claim(backbone_gw->bat_priv, (uint8_t *)(& backbone_gw->orig), (int )backbone_gw->vid, 3); tmp___0 = atomic_read((atomic_t const *)(& backbone_gw->request_sent)); if (tmp___0 == 0) { atomic_inc(& (backbone_gw->bat_priv)->bla.num_requests); atomic_set(& backbone_gw->request_sent, 1); } else { } return; } } static void batadv_bla_send_announce(struct batadv_priv *bat_priv , struct batadv_bla_backbone_gw *backbone_gw ) { uint8_t mac[6U] ; __be16 crc ; size_t __len ; void *__ret ; __u16 tmp ; size_t __len___0 ; void *__ret___0 ; { __len = 4UL; if (__len > 63UL) { __ret = __memcpy((void *)(& mac), (void const *)(& batadv_announce_mac), __len); } else { __ret = __builtin_memcpy((void *)(& mac), (void const *)(& batadv_announce_mac), __len); } tmp = __fswab16((int )backbone_gw->crc); crc = tmp; __len___0 = 2UL; if (__len___0 > 63UL) { __ret___0 = __memcpy((void *)(& mac) + 4U, (void const *)(& crc), __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& mac) + 4U, (void const *)(& crc), __len___0); } batadv_bla_send_claim(bat_priv, (uint8_t *)(& mac), (int )backbone_gw->vid, 2); return; } } static void batadv_bla_add_claim(struct batadv_priv *bat_priv , uint8_t const *mac , unsigned short const vid , struct batadv_bla_backbone_gw *backbone_gw ) { struct batadv_bla_claim *claim ; struct batadv_bla_claim search_claim ; int hash_added ; void *tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; u16 tmp___3 ; u16 tmp___4 ; { ether_addr_copy((u8 *)(& search_claim.addr), mac); search_claim.vid = vid; claim = batadv_claim_hash_find(bat_priv, & search_claim); if ((unsigned long )claim == (unsigned long )((struct batadv_bla_claim *)0)) { tmp = kzalloc(64UL, 32U); claim = (struct batadv_bla_claim *)tmp; if ((unsigned long )claim == (unsigned long )((struct batadv_bla_claim *)0)) { return; } else { } ether_addr_copy((u8 *)(& claim->addr), mac); claim->vid = vid; claim->lasttime = jiffies; claim->backbone_gw = backbone_gw; atomic_set(& claim->refcount, 2); tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 8) != 0) { batadv_debug_log(bat_priv, "bla_add_claim(): adding new entry %pM, vid %d to hash ...\n", mac, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } hash_added = batadv_hash_add___0(bat_priv->bla.claim_hash, & batadv_compare_claim, & batadv_choose_claim, (void const *)claim, & claim->hash_entry); tmp___1 = ldv__builtin_expect(hash_added != 0, 0L); if (tmp___1 != 0L) { kfree((void const *)claim); return; } else { } } else { claim->lasttime = jiffies; if ((unsigned long )claim->backbone_gw == (unsigned long )backbone_gw) { goto claim_free_ref; } else { } tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 8) != 0) { batadv_debug_log(bat_priv, "bla_add_claim(): changing ownership for %pM, vid %d\n", mac, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } tmp___3 = crc16(0, (u8 const *)(& claim->addr), 6UL); (claim->backbone_gw)->crc = (uint16_t )((int )(claim->backbone_gw)->crc ^ (int )tmp___3); batadv_backbone_gw_free_ref(claim->backbone_gw); } atomic_inc(& backbone_gw->refcount); claim->backbone_gw = backbone_gw; tmp___4 = crc16(0, (u8 const *)(& claim->addr), 6UL); backbone_gw->crc = (uint16_t )((int )backbone_gw->crc ^ (int )tmp___4); backbone_gw->lasttime = jiffies; claim_free_ref: batadv_claim_free_ref(claim); return; } } static void batadv_bla_del_claim(struct batadv_priv *bat_priv , uint8_t const *mac , unsigned short const vid ) { struct batadv_bla_claim search_claim ; struct batadv_bla_claim *claim ; int tmp ; u16 tmp___0 ; { ether_addr_copy((u8 *)(& search_claim.addr), mac); search_claim.vid = vid; claim = batadv_claim_hash_find(bat_priv, & search_claim); if ((unsigned long )claim == (unsigned long )((struct batadv_bla_claim *)0)) { return; } else { } tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 8) != 0) { batadv_debug_log(bat_priv, "bla_del_claim(): %pM, vid %d\n", mac, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } batadv_hash_remove(bat_priv->bla.claim_hash, & batadv_compare_claim, & batadv_choose_claim, (void *)claim); batadv_claim_free_ref(claim); tmp___0 = crc16(0, (u8 const *)(& claim->addr), 6UL); (claim->backbone_gw)->crc = (uint16_t )((int )(claim->backbone_gw)->crc ^ (int )tmp___0); batadv_claim_free_ref(claim); return; } } static int batadv_handle_announce(struct batadv_priv *bat_priv , uint8_t *an_addr , uint8_t *backbone_addr , unsigned short vid ) { struct batadv_bla_backbone_gw *backbone_gw ; uint16_t crc ; int tmp ; long tmp___0 ; __u16 tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = memcmp((void const *)an_addr, (void const *)(& batadv_announce_mac), 4UL); if (tmp != 0) { return (0); } else { } backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, (int )vid, 0); tmp___0 = ldv__builtin_expect((unsigned long )backbone_gw == (unsigned long )((struct batadv_bla_backbone_gw *)0), 0L); if (tmp___0 != 0L) { return (1); } else { } backbone_gw->lasttime = jiffies; tmp___1 = __fswab16((int )*((__be16 *)an_addr + 4U)); crc = tmp___1; tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 8) != 0) { batadv_debug_log(bat_priv, "handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %#.4x\n", (int )((short )vid) < 0 ? (int )vid & 4095 : -1, (uint8_t *)(& backbone_gw->orig), (int )crc); } else { } if ((int )backbone_gw->crc != (int )crc) { tmp___3 = atomic_read((atomic_t const *)(& (backbone_gw->bat_priv)->log_level)); if ((tmp___3 & 8) != 0) { batadv_debug_log(backbone_gw->bat_priv, "handle_announce(): CRC FAILED for %pM/%d (my = %#.4x, sent = %#.4x)\n", (uint8_t *)(& backbone_gw->orig), (int )((short )backbone_gw->vid) < 0 ? (int )backbone_gw->vid & 4095 : -1, (int )backbone_gw->crc, (int )crc); } else { } batadv_bla_send_request(backbone_gw); } else { tmp___4 = atomic_read((atomic_t const *)(& backbone_gw->request_sent)); if (tmp___4 != 0) { atomic_dec(& (backbone_gw->bat_priv)->bla.num_requests); atomic_set(& backbone_gw->request_sent, 0); } else { } } batadv_backbone_gw_free_ref(backbone_gw); return (1); } } static int batadv_handle_request(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , uint8_t *backbone_addr , struct ethhdr *ethhdr , unsigned short vid ) { int tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_compare_eth((void const *)backbone_addr, (void const *)(& ethhdr->h_dest)); if (tmp == 0) { return (0); } else { } tmp___0 = batadv_compare_eth((void const *)(& ethhdr->h_dest), (void const *)(primary_if->net_dev)->dev_addr); if (tmp___0 == 0) { return (1); } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 8) != 0) { batadv_debug_log(bat_priv, "handle_request(): REQUEST vid %d (sent by %pM)...\n", (int )((short )vid) < 0 ? (int )vid & 4095 : -1, (unsigned char *)(& ethhdr->h_source)); } else { } batadv_bla_answer_request(bat_priv, primary_if, (int )vid); return (1); } } static int batadv_handle_unclaim(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , uint8_t *backbone_addr , uint8_t *claim_addr , unsigned short vid ) { struct batadv_bla_backbone_gw *backbone_gw ; int tmp ; int tmp___0 ; { if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { tmp = batadv_compare_eth((void const *)backbone_addr, (void const *)(primary_if->net_dev)->dev_addr); if (tmp != 0) { batadv_bla_send_claim(bat_priv, claim_addr, (int )vid, 1); } else { } } else { } backbone_gw = batadv_backbone_hash_find(bat_priv, backbone_addr, (int )vid); if ((unsigned long )backbone_gw == (unsigned long )((struct batadv_bla_backbone_gw *)0)) { return (1); } else { } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 8) != 0) { batadv_debug_log(bat_priv, "handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n", claim_addr, (int )((short )vid) < 0 ? (int )vid & 4095 : -1, (uint8_t *)(& backbone_gw->orig)); } else { } batadv_bla_del_claim(bat_priv, (uint8_t const *)claim_addr, (int )vid); batadv_backbone_gw_free_ref(backbone_gw); return (1); } } static int batadv_handle_claim(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , uint8_t *backbone_addr , uint8_t *claim_addr , unsigned short vid ) { struct batadv_bla_backbone_gw *backbone_gw ; long tmp ; int tmp___0 ; { backbone_gw = batadv_bla_get_backbone_gw(bat_priv, backbone_addr, (int )vid, 0); tmp = ldv__builtin_expect((unsigned long )backbone_gw == (unsigned long )((struct batadv_bla_backbone_gw *)0), 0L); if (tmp != 0L) { return (1); } else { } batadv_bla_add_claim(bat_priv, (uint8_t const *)claim_addr, (int )vid, backbone_gw); tmp___0 = batadv_compare_eth((void const *)backbone_addr, (void const *)(primary_if->net_dev)->dev_addr); if (tmp___0 != 0) { batadv_bla_send_claim(bat_priv, claim_addr, (int )vid, 0); } else { } batadv_backbone_gw_free_ref(backbone_gw); return (1); } } static int batadv_check_claim_group(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , uint8_t *hw_src , uint8_t *hw_dst , struct ethhdr *ethhdr ) { uint8_t *backbone_addr ; struct batadv_orig_node *orig_node ; struct batadv_bla_claim_dst *bla_dst ; struct batadv_bla_claim_dst *bla_dst_own ; int tmp ; int tmp___0 ; __u16 tmp___1 ; int tmp___2 ; __u16 tmp___3 ; __u16 tmp___4 ; { bla_dst = (struct batadv_bla_claim_dst *)hw_dst; bla_dst_own = & bat_priv->bla.claim_dest; tmp = memcmp((void const *)(& bla_dst->magic), (void const *)(& bla_dst_own->magic), 3UL); if (tmp != 0) { return (0); } else { } switch ((int )bla_dst->type) { case 0: backbone_addr = hw_src; goto ldv_50113; case 3: ; case 2: ; case 1: backbone_addr = (uint8_t *)(& ethhdr->h_source); goto ldv_50113; default: ; return (0); } ldv_50113: tmp___0 = batadv_compare_eth((void const *)backbone_addr, (void const *)(primary_if->net_dev)->dev_addr); if (tmp___0 != 0) { return (0); } else { } if ((int )bla_dst->group == (int )bla_dst_own->group) { return (2); } else { } orig_node = batadv_orig_hash_find___0(bat_priv, (void const *)backbone_addr); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return (1); } else { } tmp___3 = __fswab16((int )bla_dst->group); tmp___4 = __fswab16((int )bla_dst_own->group); if ((int )tmp___3 > (int )tmp___4) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 8) != 0) { tmp___1 = __fswab16((int )bla_dst->group); batadv_debug_log(bat_priv, "taking other backbones claim group: %#.4x\n", (int )tmp___1); } else { } bla_dst_own->group = bla_dst->group; } else { } batadv_orig_node_free_ref(orig_node); return (2); } } static int batadv_bla_process_claim(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , struct sk_buff *skb ) { struct batadv_bla_claim_dst *bla_dst ; uint8_t *hw_src ; uint8_t *hw_dst ; struct vlan_ethhdr *vhdr ; struct ethhdr *ethhdr ; struct arphdr *arphdr ; unsigned short vid ; __be16 proto ; int headlen ; int ret ; int tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; { vid = batadv_get_vid(skb, 0UL); ethhdr = eth_hdr((struct sk_buff const *)skb); proto = ethhdr->h_proto; headlen = 14; if ((int )((short )vid) < 0) { vhdr = vlan_eth_hdr((struct sk_buff const *)skb); proto = vhdr->h_vlan_encapsulated_proto; headlen = headlen + 4; } else { } if ((unsigned int )proto != 1544U) { return (0); } else { } tmp = arp_hdr_len(skb->dev); tmp___0 = pskb_may_pull(skb, (unsigned int )(tmp + headlen)); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { return (0); } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); arphdr = (struct arphdr *)ethhdr + (unsigned long )headlen; if ((unsigned int )arphdr->ar_hrd != 256U) { return (0); } else { } if ((unsigned int )arphdr->ar_pro != 8U) { return (0); } else { } if ((unsigned int )arphdr->ar_hln != 6U) { return (0); } else { } if ((unsigned int )arphdr->ar_pln != 4U) { return (0); } else { } hw_src = (uint8_t *)arphdr + 8UL; hw_dst = hw_src + 10U; bla_dst = (struct batadv_bla_claim_dst *)hw_dst; ret = batadv_check_claim_group(bat_priv, primary_if, hw_src, hw_dst, ethhdr); if (ret == 1) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 8) != 0) { batadv_debug_log(bat_priv, "bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", (unsigned char *)(& ethhdr->h_source), (int )((short )vid) < 0 ? (int )vid & 4095 : -1, hw_src, hw_dst); } else { } } else { } if (ret <= 1) { return (ret); } else { } batadv_bla_update_own_backbone_gw(bat_priv, primary_if, (int )vid); switch ((int )bla_dst->type) { case 0: tmp___3 = batadv_handle_claim(bat_priv, primary_if, hw_src, (uint8_t *)(& ethhdr->h_source), (int )vid); if (tmp___3 != 0) { return (1); } else { } goto ldv_50134; case 1: tmp___4 = batadv_handle_unclaim(bat_priv, primary_if, (uint8_t *)(& ethhdr->h_source), hw_src, (int )vid); if (tmp___4 != 0) { return (1); } else { } goto ldv_50134; case 2: tmp___5 = batadv_handle_announce(bat_priv, hw_src, (uint8_t *)(& ethhdr->h_source), (int )vid); if (tmp___5 != 0) { return (1); } else { } goto ldv_50134; case 3: tmp___6 = batadv_handle_request(bat_priv, primary_if, hw_src, ethhdr, (int )vid); if (tmp___6 != 0) { return (1); } else { } goto ldv_50134; } ldv_50134: tmp___7 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___7 & 8) != 0) { batadv_debug_log(bat_priv, "bla_process_claim(): OLD_ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", (unsigned char *)(& ethhdr->h_source), (int )((short )vid) < 0 ? (int )vid & 4095 : -1, hw_src, hw_dst); } else { } return (1); } } static void batadv_bla_purge_backbone_gw(struct batadv_priv *bat_priv , int now ) { struct batadv_bla_backbone_gw *backbone_gw ; struct hlist_node *node_tmp ; struct hlist_head *head ; struct batadv_hashtable *hash ; spinlock_t *list_lock ; int i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_bla_backbone_gw *tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_backbone_gw *tmp___4 ; { hash = bat_priv->bla.backbone_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0; goto ldv_50163; ldv_50162: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_bla_backbone_gw *)__mptr + 0xfffffffffffffff8UL; } else { tmp = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp; goto ldv_50160; ldv_50159: ; if (now != 0) { goto purge_now; } else { } tmp___0 = batadv_has_timed_out(backbone_gw->lasttime, 30000U); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_50158; } else { } tmp___2 = atomic_read((atomic_t const *)(& (backbone_gw->bat_priv)->log_level)); if ((tmp___2 & 8) != 0) { batadv_debug_log(backbone_gw->bat_priv, "bla_purge_backbone_gw(): backbone gw %pM timed out\n", (uint8_t *)(& backbone_gw->orig)); } else { } purge_now: tmp___3 = atomic_read((atomic_t const *)(& backbone_gw->request_sent)); if (tmp___3 != 0) { atomic_dec(& bat_priv->bla.num_requests); } else { } batadv_bla_del_backbone_claims(backbone_gw); hlist_del_rcu(& backbone_gw->hash_entry); batadv_backbone_gw_free_ref(backbone_gw); ldv_50158: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_bla_backbone_gw *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___4 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___4; ldv_50160: ; if ((unsigned long )backbone_gw != (unsigned long )((struct batadv_bla_backbone_gw *)0)) { node_tmp = backbone_gw->hash_entry.next; goto ldv_50159; } else { } spin_unlock_bh(list_lock); i = i + 1; ldv_50163: ; if ((uint32_t )i < hash->size) { goto ldv_50162; } else { } return; } } static void batadv_bla_purge_claims(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , int now ) { struct batadv_bla_claim *claim ; struct hlist_head *head ; struct batadv_hashtable *hash ; int i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_bla_claim *tmp___0 ; int tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___5 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_claim *tmp___6 ; { hash = bat_priv->bla.claim_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0; goto ldv_50200; ldv_50199: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_bla_claim *)__mptr + 0xffffffffffffffe8UL; } else { tmp___0 = (struct batadv_bla_claim *)0; } claim = tmp___0; goto ldv_50197; ldv_50196: ; if (now != 0) { goto purge_now; } else { } tmp___1 = batadv_compare_eth((void const *)(& (claim->backbone_gw)->orig), (void const *)(primary_if->net_dev)->dev_addr); if (tmp___1 == 0) { goto ldv_50195; } else { } tmp___2 = batadv_has_timed_out(claim->lasttime, 100000U); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { goto ldv_50195; } else { } tmp___4 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___4 & 8) != 0) { batadv_debug_log(bat_priv, "bla_purge_claims(): %pM, vid %d, time out\n", (uint8_t *)(& claim->addr), (int )claim->vid); } else { } purge_now: batadv_handle_unclaim(bat_priv, primary_if, (uint8_t *)(& (claim->backbone_gw)->orig), (uint8_t *)(& claim->addr), (int )claim->vid); ldv_50195: _________p1___0 = *((struct hlist_node * volatile *)(& claim->hash_entry.next)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___6 = (struct batadv_bla_claim *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___6 = (struct batadv_bla_claim *)0; } claim = tmp___6; ldv_50197: ; if ((unsigned long )claim != (unsigned long )((struct batadv_bla_claim *)0)) { goto ldv_50196; } else { } rcu_read_unlock(); i = i + 1; ldv_50200: ; if ((uint32_t )i < hash->size) { goto ldv_50199; } else { } return; } } void batadv_bla_update_orig_address(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if , struct batadv_hard_iface *oldif ) { struct batadv_bla_backbone_gw *backbone_gw ; struct hlist_head *head ; struct batadv_hashtable *hash ; __be16 group ; int i ; u16 tmp ; __u16 tmp___0 ; int tmp___1 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___2 ; struct hlist_node const *__mptr ; struct batadv_bla_backbone_gw *tmp___3 ; int tmp___4 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___5 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_backbone_gw *tmp___6 ; { tmp = crc16(0, (u8 const *)(primary_if->net_dev)->dev_addr, 6UL); tmp___0 = __fswab16((int )tmp); group = tmp___0; bat_priv->bla.claim_dest.group = group; tmp___1 = atomic_read((atomic_t const *)(& bat_priv->bridge_loop_avoidance)); if (tmp___1 == 0) { oldif = (struct batadv_hard_iface *)0; } else { } if ((unsigned long )oldif == (unsigned long )((struct batadv_hard_iface *)0)) { batadv_bla_purge_claims(bat_priv, (struct batadv_hard_iface *)0, 1); batadv_bla_purge_backbone_gw(bat_priv, 1); return; } else { } hash = bat_priv->bla.backbone_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0; goto ldv_50237; ldv_50236: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___3 = (struct batadv_bla_backbone_gw *)__mptr + 0xfffffffffffffff8UL; } else { tmp___3 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___3; goto ldv_50234; ldv_50233: tmp___4 = batadv_compare_eth((void const *)(& backbone_gw->orig), (void const *)(oldif->net_dev)->dev_addr); if (tmp___4 == 0) { goto ldv_50232; } else { } ether_addr_copy((u8 *)(& backbone_gw->orig), (u8 const *)(primary_if->net_dev)->dev_addr); batadv_bla_send_announce(bat_priv, backbone_gw); ldv_50232: _________p1___0 = *((struct hlist_node * volatile *)(& backbone_gw->hash_entry.next)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___6 = (struct batadv_bla_backbone_gw *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___6 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___6; ldv_50234: ; if ((unsigned long )backbone_gw != (unsigned long )((struct batadv_bla_backbone_gw *)0)) { goto ldv_50233; } else { } rcu_read_unlock(); i = i + 1; ldv_50237: ; if ((uint32_t )i < hash->size) { goto ldv_50236; } else { } return; } } static void batadv_bla_periodic_work(struct work_struct *work ) { struct delayed_work *delayed_work ; struct batadv_priv *bat_priv ; struct batadv_priv_bla *priv_bla ; struct hlist_head *head ; struct batadv_bla_backbone_gw *backbone_gw ; struct batadv_hashtable *hash ; struct batadv_hard_iface *primary_if ; int i ; struct work_struct const *__mptr ; struct delayed_work const *__mptr___0 ; struct batadv_priv_bla const *__mptr___1 ; int tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr___2 ; struct batadv_bla_backbone_gw *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___5 ; struct hlist_node const *__mptr___3 ; struct batadv_bla_backbone_gw *tmp___6 ; unsigned long tmp___7 ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; priv_bla = (struct batadv_priv_bla *)__mptr___0 + 0xfffffffffffffe10UL; __mptr___1 = (struct batadv_priv_bla const *)priv_bla; bat_priv = (struct batadv_priv *)__mptr___1 + 0xfffffffffffffc98UL; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } batadv_bla_purge_claims(bat_priv, primary_if, 0); batadv_bla_purge_backbone_gw(bat_priv, 0); tmp = atomic_read((atomic_t const *)(& bat_priv->bridge_loop_avoidance)); if (tmp == 0) { goto out; } else { } hash = bat_priv->bla.backbone_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { goto out; } else { } i = 0; goto ldv_50282; ldv_50281: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr___2 = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_bla_backbone_gw *)__mptr___2 + 0xfffffffffffffff8UL; } else { tmp___1 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___1; goto ldv_50279; ldv_50278: tmp___2 = batadv_compare_eth((void const *)(& backbone_gw->orig), (void const *)(primary_if->net_dev)->dev_addr); if (tmp___2 == 0) { goto ldv_50277; } else { } backbone_gw->lasttime = jiffies; batadv_bla_send_announce(bat_priv, backbone_gw); tmp___3 = atomic_read((atomic_t const *)(& backbone_gw->request_sent)); if (tmp___3 == 0) { goto ldv_50277; } else { } tmp___4 = atomic_dec_and_test(& backbone_gw->wait_periods); if (tmp___4 == 0) { goto ldv_50277; } else { } atomic_dec(& (backbone_gw->bat_priv)->bla.num_requests); atomic_set(& backbone_gw->request_sent, 0); ldv_50277: _________p1___0 = *((struct hlist_node * volatile *)(& backbone_gw->hash_entry.next)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___3 = (struct hlist_node const *)____ptr___0; tmp___6 = (struct batadv_bla_backbone_gw *)__mptr___3 + 0xfffffffffffffff8UL; } else { tmp___6 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___6; ldv_50279: ; if ((unsigned long )backbone_gw != (unsigned long )((struct batadv_bla_backbone_gw *)0)) { goto ldv_50278; } else { } rcu_read_unlock(); i = i + 1; ldv_50282: ; if ((uint32_t )i < hash->size) { goto ldv_50281; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } tmp___7 = msecs_to_jiffies(10000U); queue_delayed_work(batadv_event_workqueue, & bat_priv->bla.work, tmp___7); return; } } static struct lock_class_key batadv_claim_hash_lock_class_key ; static struct lock_class_key batadv_backbone_hash_lock_class_key ; int batadv_bla_init(struct batadv_priv *bat_priv ) { int i ; uint8_t claim_dest[6U] ; struct batadv_hard_iface *primary_if ; uint16_t crc ; unsigned long entrytime ; struct lock_class_key __key ; int tmp ; size_t __len ; void *__ret ; __u16 tmp___0 ; unsigned long tmp___1 ; int tmp___2 ; struct lock_class_key __key___0 ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___1 ; unsigned long tmp___3 ; { claim_dest[0] = 255U; claim_dest[1] = 67U; claim_dest[2] = 5U; claim_dest[3] = 0U; claim_dest[4] = 0U; claim_dest[5] = 0U; spinlock_check(& bat_priv->bla.bcast_duplist_lock); __raw_spin_lock_init(& bat_priv->bla.bcast_duplist_lock.ldv_6347.rlock, "&(&bat_priv->bla.bcast_duplist_lock)->rlock", & __key); tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 8) != 0) { batadv_debug_log(bat_priv, "bla hash registering\n"); } else { } __len = 3UL; if (__len > 63UL) { __ret = __memcpy((void *)(& bat_priv->bla.claim_dest.magic), (void const *)(& claim_dest), __len); } else { __ret = __builtin_memcpy((void *)(& bat_priv->bla.claim_dest.magic), (void const *)(& claim_dest), __len); } bat_priv->bla.claim_dest.type = 0U; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { crc = crc16(0, (u8 const *)(primary_if->net_dev)->dev_addr, 6UL); tmp___0 = __fswab16((int )crc); bat_priv->bla.claim_dest.group = tmp___0; batadv_hardif_free_ref(primary_if); } else { bat_priv->bla.claim_dest.group = 0U; } tmp___1 = msecs_to_jiffies(500U); entrytime = (unsigned long )jiffies - tmp___1; i = 0; goto ldv_50299; ldv_50298: bat_priv->bla.bcast_duplist[i].entrytime = entrytime; i = i + 1; ldv_50299: ; if (i <= 15) { goto ldv_50298; } else { } bat_priv->bla.bcast_duplist_curr = 0; if ((unsigned long )bat_priv->bla.claim_hash != (unsigned long )((struct batadv_hashtable *)0)) { return (0); } else { } bat_priv->bla.claim_hash = batadv_hash_new(128U); bat_priv->bla.backbone_hash = batadv_hash_new(32U); if ((unsigned long )bat_priv->bla.claim_hash == (unsigned long )((struct batadv_hashtable *)0) || (unsigned long )bat_priv->bla.backbone_hash == (unsigned long )((struct batadv_hashtable *)0)) { return (-12); } else { } batadv_hash_set_lock_class(bat_priv->bla.claim_hash, & batadv_claim_hash_lock_class_key); batadv_hash_set_lock_class(bat_priv->bla.backbone_hash, & batadv_backbone_hash_lock_class_key); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 8) != 0) { batadv_debug_log(bat_priv, "bla hashes initialized\n"); } else { } __init_work(& bat_priv->bla.work.work, 0); __constr_expr_0.counter = 137438953408L; bat_priv->bla.work.work.data = __constr_expr_0; lockdep_init_map(& bat_priv->bla.work.work.lockdep_map, "(&(&bat_priv->bla.work)->work)", & __key___0, 0); INIT_LIST_HEAD(& bat_priv->bla.work.work.entry); bat_priv->bla.work.work.func = & batadv_bla_periodic_work; init_timer_key(& bat_priv->bla.work.timer, 2U, "(&(&bat_priv->bla.work)->timer)", & __key___1); bat_priv->bla.work.timer.function = & delayed_work_timer_fn; bat_priv->bla.work.timer.data = (unsigned long )(& bat_priv->bla.work); tmp___3 = msecs_to_jiffies(10000U); queue_delayed_work(batadv_event_workqueue, & bat_priv->bla.work, tmp___3); return (0); } } int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv , struct sk_buff *skb ) { int i ; int curr ; int ret ; __be32 crc ; struct batadv_bcast_packet *bcast_packet ; struct batadv_bcast_duplist_entry *entry ; bool tmp ; int tmp___0 ; { ret = 0; bcast_packet = (struct batadv_bcast_packet *)skb->data; crc = batadv_skb_crc32(skb, (u8 *)bcast_packet + 1U); spin_lock_bh(& bat_priv->bla.bcast_duplist_lock); i = 0; goto ldv_50318; ldv_50317: curr = bat_priv->bla.bcast_duplist_curr + i; curr = curr % 16; entry = (struct batadv_bcast_duplist_entry *)(& bat_priv->bla.bcast_duplist) + (unsigned long )curr; tmp = batadv_has_timed_out(entry->entrytime, 500U); if ((int )tmp) { goto ldv_50314; } else { } if (entry->crc != crc) { goto ldv_50315; } else { } tmp___0 = batadv_compare_eth((void const *)(& entry->orig), (void const *)(& bcast_packet->orig)); if (tmp___0 != 0) { goto ldv_50315; } else { } ret = 1; goto out; ldv_50315: i = i + 1; ldv_50318: ; if (i <= 15) { goto ldv_50317; } else { } ldv_50314: curr = bat_priv->bla.bcast_duplist_curr + 15; curr = curr % 16; entry = (struct batadv_bcast_duplist_entry *)(& bat_priv->bla.bcast_duplist) + (unsigned long )curr; entry->crc = crc; entry->entrytime = jiffies; ether_addr_copy((u8 *)(& entry->orig), (u8 const *)(& bcast_packet->orig)); bat_priv->bla.bcast_duplist_curr = curr; out: spin_unlock_bh(& bat_priv->bla.bcast_duplist_lock); return (ret); } } bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv , uint8_t *orig , unsigned short vid ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_bla_backbone_gw *backbone_gw ; int i ; int tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_bla_backbone_gw *tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_backbone_gw *tmp___4 ; { hash = bat_priv->bla.backbone_hash; tmp = atomic_read((atomic_t const *)(& bat_priv->bridge_loop_avoidance)); if (tmp == 0) { return (0); } else { } if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return (0); } else { } i = 0; goto ldv_50352; ldv_50351: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_bla_backbone_gw *)__mptr + 0xfffffffffffffff8UL; } else { tmp___1 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___1; goto ldv_50349; ldv_50348: tmp___2 = batadv_compare_eth((void const *)(& backbone_gw->orig), (void const *)orig); if (tmp___2 != 0 && (int )backbone_gw->vid == (int )vid) { rcu_read_unlock(); return (1); } else { } _________p1___0 = *((struct hlist_node * volatile *)(& backbone_gw->hash_entry.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_bla_backbone_gw *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___4 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___4; ldv_50349: ; if ((unsigned long )backbone_gw != (unsigned long )((struct batadv_bla_backbone_gw *)0)) { goto ldv_50348; } else { } rcu_read_unlock(); i = i + 1; ldv_50352: ; if ((uint32_t )i < hash->size) { goto ldv_50351; } else { } return (0); } } int batadv_bla_is_backbone_gw(struct sk_buff *skb , struct batadv_orig_node *orig_node , int hdr_size ) { struct batadv_bla_backbone_gw *backbone_gw ; unsigned short vid ; int tmp ; int tmp___0 ; { tmp = atomic_read((atomic_t const *)(& (orig_node->bat_priv)->bridge_loop_avoidance)); if (tmp == 0) { return (0); } else { } tmp___0 = pskb_may_pull(skb, (unsigned int )(hdr_size + 14)); if (tmp___0 == 0) { return (0); } else { } vid = batadv_get_vid(skb, (size_t )hdr_size); backbone_gw = batadv_backbone_hash_find(orig_node->bat_priv, (uint8_t *)(& orig_node->orig), (int )vid); if ((unsigned long )backbone_gw == (unsigned long )((struct batadv_bla_backbone_gw *)0)) { return (0); } else { } batadv_backbone_gw_free_ref(backbone_gw); return (1); } } void batadv_bla_free(struct batadv_priv *bat_priv ) { struct batadv_hard_iface *primary_if ; { cancel_delayed_work_sync(& bat_priv->bla.work); primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )bat_priv->bla.claim_hash != (unsigned long )((struct batadv_hashtable *)0)) { batadv_bla_purge_claims(bat_priv, primary_if, 1); batadv_hash_destroy(bat_priv->bla.claim_hash); bat_priv->bla.claim_hash = (struct batadv_hashtable *)0; } else { } if ((unsigned long )bat_priv->bla.backbone_hash != (unsigned long )((struct batadv_hashtable *)0)) { batadv_bla_purge_backbone_gw(bat_priv, 1); batadv_hash_destroy(bat_priv->bla.backbone_hash); bat_priv->bla.backbone_hash = (struct batadv_hashtable *)0; } else { } if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } int batadv_bla_rx(struct batadv_priv *bat_priv , struct sk_buff *skb , unsigned short vid , bool is_bcast ) { struct ethhdr *ethhdr ; struct batadv_bla_claim search_claim ; struct batadv_bla_claim *claim ; struct batadv_hard_iface *primary_if ; int ret ; int tmp ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; bool tmp___4 ; { claim = (struct batadv_bla_claim *)0; ethhdr = eth_hdr((struct sk_buff const *)skb); primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto handled; } else { } tmp = atomic_read((atomic_t const *)(& bat_priv->bridge_loop_avoidance)); if (tmp == 0) { goto allow; } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->bla.num_requests)); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); if (tmp___2 != 0L) { tmp___0 = is_multicast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___0 && (int )is_bcast) { goto handled; } else { } } else { } ether_addr_copy((u8 *)(& search_claim.addr), (u8 const *)(& ethhdr->h_source)); search_claim.vid = vid; claim = batadv_claim_hash_find(bat_priv, & search_claim); if ((unsigned long )claim == (unsigned long )((struct batadv_bla_claim *)0)) { batadv_handle_claim(bat_priv, primary_if, (primary_if->net_dev)->dev_addr, (uint8_t *)(& ethhdr->h_source), (int )vid); goto allow; } else { } tmp___3 = batadv_compare_eth((void const *)(& (claim->backbone_gw)->orig), (void const *)(primary_if->net_dev)->dev_addr); if (tmp___3 != 0) { claim->lasttime = jiffies; goto allow; } else { } tmp___4 = is_multicast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___4 && (int )is_bcast) { goto handled; } else { batadv_handle_claim(bat_priv, primary_if, (primary_if->net_dev)->dev_addr, (uint8_t *)(& ethhdr->h_source), (int )vid); goto allow; } allow: batadv_bla_update_own_backbone_gw(bat_priv, primary_if, (int )vid); ret = 0; goto out; handled: kfree_skb(skb); ret = 1; out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } if ((unsigned long )claim != (unsigned long )((struct batadv_bla_claim *)0)) { batadv_claim_free_ref(claim); } else { } return (ret); } } int batadv_bla_tx(struct batadv_priv *bat_priv , struct sk_buff *skb , unsigned short vid ) { struct ethhdr *ethhdr ; struct batadv_bla_claim search_claim ; struct batadv_bla_claim *claim ; struct batadv_hard_iface *primary_if ; int ret ; int tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; int tmp___4 ; bool tmp___5 ; { claim = (struct batadv_bla_claim *)0; ret = 0; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } tmp = atomic_read((atomic_t const *)(& bat_priv->bridge_loop_avoidance)); if (tmp == 0) { goto allow; } else { } tmp___0 = batadv_bla_process_claim(bat_priv, primary_if, skb); if (tmp___0 != 0) { goto handled; } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->bla.num_requests)); tmp___3 = ldv__builtin_expect(tmp___2 != 0, 0L); if (tmp___3 != 0L) { tmp___1 = is_multicast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___1) { goto handled; } else { } } else { } ether_addr_copy((u8 *)(& search_claim.addr), (u8 const *)(& ethhdr->h_source)); search_claim.vid = vid; claim = batadv_claim_hash_find(bat_priv, & search_claim); if ((unsigned long )claim == (unsigned long )((struct batadv_bla_claim *)0)) { goto allow; } else { } tmp___4 = batadv_compare_eth((void const *)(& (claim->backbone_gw)->orig), (void const *)(primary_if->net_dev)->dev_addr); if (tmp___4 != 0) { batadv_handle_unclaim(bat_priv, primary_if, (primary_if->net_dev)->dev_addr, (uint8_t *)(& ethhdr->h_source), (int )vid); goto allow; } else { } tmp___5 = is_multicast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___5) { goto handled; } else { } allow: batadv_bla_update_own_backbone_gw(bat_priv, primary_if, (int )vid); ret = 0; goto out; handled: ret = 1; out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } if ((unsigned long )claim != (unsigned long )((struct batadv_bla_claim *)0)) { batadv_claim_free_ref(claim); } else { } return (ret); } } int batadv_bla_claim_table_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct batadv_bla_claim *claim ; struct batadv_hard_iface *primary_if ; struct hlist_head *head ; uint32_t i ; bool is_own ; uint8_t *primary_addr ; __u16 tmp___0 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___1 ; struct hlist_node const *__mptr ; struct batadv_bla_claim *tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_claim *tmp___5 ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->bla.claim_hash; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } primary_addr = (primary_if->net_dev)->dev_addr; tmp___0 = __fswab16((int )bat_priv->bla.claim_dest.group); seq_printf(seq, "Claims announced for the mesh %s (orig %pM, group id %#.4x)\n", (char *)(& net_dev->name), primary_addr, (int )tmp___0); seq_printf(seq, " %-17s %-5s %-17s [o] (%-6s)\n", (char *)"Client", (char *)"VID", (char *)"Originator", (char *)"CRC"); i = 0U; goto ldv_50430; ldv_50429: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___2 = (struct batadv_bla_claim *)__mptr + 0xffffffffffffffe8UL; } else { tmp___2 = (struct batadv_bla_claim *)0; } claim = tmp___2; goto ldv_50427; ldv_50426: tmp___3 = batadv_compare_eth((void const *)(& (claim->backbone_gw)->orig), (void const *)primary_addr); is_own = tmp___3 != 0; seq_printf(seq, " * %pM on %5d by %pM [%c] (%#.4x)\n", (uint8_t *)(& claim->addr), (int )((short )claim->vid) < 0 ? (int )claim->vid & 4095 : -1, (uint8_t *)(& (claim->backbone_gw)->orig), (int )is_own ? 120 : 32, (int )(claim->backbone_gw)->crc); _________p1___0 = *((struct hlist_node * volatile *)(& claim->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_bla_claim *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___5 = (struct batadv_bla_claim *)0; } claim = tmp___5; ldv_50427: ; if ((unsigned long )claim != (unsigned long )((struct batadv_bla_claim *)0)) { goto ldv_50426; } else { } rcu_read_unlock(); i = i + 1U; ldv_50430: ; if (hash->size > i) { goto ldv_50429; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct batadv_bla_backbone_gw *backbone_gw ; struct batadv_hard_iface *primary_if ; struct hlist_head *head ; int secs ; int msecs ; uint32_t i ; bool is_own ; uint8_t *primary_addr ; __u16 tmp___0 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___1 ; struct hlist_node const *__mptr ; struct batadv_bla_backbone_gw *tmp___2 ; unsigned int tmp___3 ; int tmp___4 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___5 ; struct hlist_node const *__mptr___0 ; struct batadv_bla_backbone_gw *tmp___6 ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->bla.backbone_hash; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } primary_addr = (primary_if->net_dev)->dev_addr; tmp___0 = __fswab16((int )bat_priv->bla.claim_dest.group); seq_printf(seq, "Backbones announced for the mesh %s (orig %pM, group id %#.4x)\n", (char *)(& net_dev->name), primary_addr, (int )tmp___0); seq_printf(seq, " %-17s %-5s %-9s (%-6s)\n", (char *)"Originator", (char *)"VID", (char *)"last seen", (char *)"CRC"); i = 0U; goto ldv_50473; ldv_50472: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___2 = (struct batadv_bla_backbone_gw *)__mptr + 0xfffffffffffffff8UL; } else { tmp___2 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___2; goto ldv_50470; ldv_50469: tmp___3 = jiffies_to_msecs((unsigned long )jiffies - backbone_gw->lasttime); msecs = (int )tmp___3; secs = msecs / 1000; msecs = msecs % 1000; tmp___4 = batadv_compare_eth((void const *)(& backbone_gw->orig), (void const *)primary_addr); is_own = tmp___4 != 0; if ((int )is_own) { goto ldv_50468; } else { } seq_printf(seq, " * %pM on %5d %4i.%03is (%#.4x)\n", (uint8_t *)(& backbone_gw->orig), (int )((short )backbone_gw->vid) < 0 ? (int )backbone_gw->vid & 4095 : -1, secs, msecs, (int )backbone_gw->crc); ldv_50468: _________p1___0 = *((struct hlist_node * volatile *)(& backbone_gw->hash_entry.next)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___6 = (struct batadv_bla_backbone_gw *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___6 = (struct batadv_bla_backbone_gw *)0; } backbone_gw = tmp___6; ldv_50470: ; if ((unsigned long )backbone_gw != (unsigned long )((struct batadv_bla_backbone_gw *)0)) { goto ldv_50469; } else { } rcu_read_unlock(); i = i + 1U; ldv_50473: ; if (hash->size > i) { goto ldv_50472; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } void *ldv_kmem_cache_alloc_108(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_114(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_116(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_118(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_119(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_120(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_121(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_122(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_123(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_124(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_125(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } void ldv__builtin_va_end(__builtin_va_list ) ; void ldv__builtin_va_start(__builtin_va_list ) ; extern struct module __this_module ; extern int vscnprintf(char * , size_t , char const * , __va_list_tag * ) ; __inline static void *ERR_PTR(long error ) { { return ((void *)error); } } extern unsigned long kernel_stack ; __inline static struct thread_info *current_thread_info(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5945; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5945; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5945; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_5945; default: __bad_percpu_size(); } ldv_5945: ti = (struct thread_info *)(pfo_ret__ - 16344UL); return (ti); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; extern void __init_waitqueue_head(wait_queue_head_t * , char const * , struct lock_class_key * ) ; extern void __wake_up(wait_queue_head_t * , unsigned int , int , void * ) ; extern long prepare_to_wait_event(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern bool try_module_get(struct module * ) ; extern void module_put(struct module * ) ; void *ldv_kmem_cache_alloc_152(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_169(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; extern size_t __VERIFIER_nondet_size_t(void) ; extern loff_t __VERIFIER_nondet_loff_t(void) ; struct file *batadv_debuginfo_bla_claim_table_group1 ; int ldv_state_variable_30 ; struct file *batadv_log_fops_group2 ; struct inode *batadv_debuginfo_bla_backbone_table_group0 ; int ldv_state_variable_29 ; int ldv_state_variable_27 ; struct inode *batadv_debuginfo_dat_cache_group0 ; int ref_cnt ; struct file *batadv_debuginfo_nc_nodes_group1 ; int ldv_state_variable_26 ; int ldv_state_variable_28 ; struct inode *batadv_debuginfo_transtable_global_group0 ; struct inode *batadv_debuginfo_bla_claim_table_group0 ; struct file *batadv_debuginfo_bla_backbone_table_group1 ; int ldv_state_variable_31 ; struct file *batadv_debuginfo_gateways_group1 ; struct inode *batadv_debuginfo_routing_algos_group0 ; struct inode *batadv_hardif_debuginfo_originators_group0 ; struct inode *batadv_debuginfo_gateways_group0 ; struct inode *batadv_log_fops_group1 ; struct file *batadv_hardif_debuginfo_originators_group1 ; int ldv_state_variable_33 ; struct inode *batadv_debuginfo_transtable_local_group0 ; struct file *batadv_debuginfo_originators_group1 ; struct inode *batadv_debuginfo_originators_group0 ; struct inode *batadv_debuginfo_nc_nodes_group0 ; int ldv_state_variable_25 ; struct file *batadv_debuginfo_routing_algos_group1 ; struct file *batadv_debuginfo_transtable_local_group1 ; int ldv_state_variable_32 ; int ldv_state_variable_34 ; struct file *batadv_debuginfo_dat_cache_group1 ; struct file *batadv_debuginfo_transtable_global_group1 ; int ldv_state_variable_35 ; void ldv_initialize_batadv_debuginfo_28(void) ; void ldv_initialize_batadv_debuginfo_33(void) ; void ldv_initialize_batadv_debuginfo_30(void) ; void ldv_file_operations_35(void) ; void ldv_initialize_batadv_debuginfo_27(void) ; void ldv_initialize_batadv_debuginfo_32(void) ; void ldv_initialize_batadv_debuginfo_29(void) ; void ldv_initialize_batadv_debuginfo_31(void) ; void ldv_initialize_batadv_debuginfo_25(void) ; void ldv_initialize_batadv_debuginfo_34(void) ; void ldv_initialize_batadv_debuginfo_26(void) ; extern ssize_t seq_read(struct file * , char * , size_t , loff_t * ) ; extern loff_t seq_lseek(struct file * , loff_t , int ) ; extern int single_open(struct file * , int (*)(struct seq_file * , void * ) , void * ) ; extern int single_release(struct inode * , struct file * ) ; extern loff_t no_llseek(struct file * , loff_t , int ) ; extern int nonseekable_open(struct inode * , struct file * ) ; extern void schedule(void) ; __inline static bool __chk_range_not_ok(unsigned long addr , unsigned long size , unsigned long limit ) { { addr = addr + size; if (addr < size) { return (1); } else { } return (addr > limit); } } extern void __put_user_bad(void) ; struct sk_buff *ldv_skb_clone_160(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_168(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_162(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_158(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_166(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_167(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_163(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_164(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_165(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static void poll_wait(struct file *filp , wait_queue_head_t *wait_address , poll_table *p ) { { if (((unsigned long )p != (unsigned long )((poll_table *)0) && (unsigned long )p->_qproc != (unsigned long )((void (*)(struct file * , wait_queue_head_t * , struct poll_table_struct * ))0)) && (unsigned long )wait_address != (unsigned long )((wait_queue_head_t *)0)) { (*(p->_qproc))(filp, wait_address, p); } else { } return; } } int batadv_algo_seq_print_text(struct seq_file *seq , void *offset ) ; extern struct dentry *debugfs_create_file(char const * , umode_t , struct dentry * , void * , struct file_operations const * ) ; extern struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern void debugfs_remove_recursive(struct dentry * ) ; void batadv_debugfs_init(void) ; void batadv_debugfs_destroy(void) ; int batadv_debugfs_add_meshif(struct net_device *dev ) ; void batadv_debugfs_del_meshif(struct net_device *dev ) ; int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface ) ; void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface ) ; int batadv_tt_local_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_tt_global_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_orig_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_orig_hardif_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_gw_client_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_socket_setup(struct batadv_priv *bat_priv ) ; int batadv_dat_cache_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_nc_nodes_seq_print_text(struct seq_file *seq , void *offset ) ; int batadv_nc_init_debugfs(struct batadv_priv *bat_priv ) ; static struct dentry *batadv_debugfs ; static int const batadv_log_buff_len = 8192; static char *batadv_log_char_addr(struct batadv_priv_debug_log *debug_log , size_t idx ) { { return ((char *)(& debug_log->log_buff) + ((size_t )((int )batadv_log_buff_len + -1) & idx)); } } static void batadv_emit_log_char(struct batadv_priv_debug_log *debug_log , char c ) { char *char_addr ; { char_addr = batadv_log_char_addr(debug_log, debug_log->log_end); *char_addr = c; debug_log->log_end = debug_log->log_end + 1UL; if (debug_log->log_end - debug_log->log_start > (unsigned long )batadv_log_buff_len) { debug_log->log_start = debug_log->log_end - (unsigned long )batadv_log_buff_len; } else { } return; } } static int batadv_fdebug_log(struct batadv_priv_debug_log *debug_log , char const *fmt , ...) { va_list args ; char debug_log_buf[256U] ; char *p ; { if ((unsigned long )debug_log == (unsigned long )((struct batadv_priv_debug_log *)0)) { return (0); } else { } spin_lock_bh(& debug_log->lock); ldv__builtin_va_start((__va_list_tag *)(& args)); vscnprintf((char *)(& debug_log_buf), 256UL, fmt, (__va_list_tag *)(& args)); ldv__builtin_va_end((__va_list_tag *)(& args)); p = (char *)(& debug_log_buf); goto ldv_49994; ldv_49993: batadv_emit_log_char(debug_log, (int )*p); p = p + 1; ldv_49994: ; if ((int )((signed char )*p) != 0) { goto ldv_49993; } else { } spin_unlock_bh(& debug_log->lock); __wake_up(& debug_log->queue_wait, 3U, 1, (void *)0); return (0); } } int batadv_debug_log(struct batadv_priv *bat_priv , char const *fmt , ...) { va_list args ; char tmp_log_buf[256U] ; unsigned int tmp ; { ldv__builtin_va_start((__va_list_tag *)(& args)); vscnprintf((char *)(& tmp_log_buf), 256UL, fmt, (__va_list_tag *)(& args)); tmp = jiffies_to_msecs(jiffies); batadv_fdebug_log(bat_priv->debug_log, "[%10u] %s", tmp, (char *)(& tmp_log_buf)); ldv__builtin_va_end((__va_list_tag *)(& args)); return (0); } } static int batadv_log_open(struct inode *inode , struct file *file ) { bool tmp ; int tmp___0 ; { tmp = try_module_get(& __this_module); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (-16); } else { } nonseekable_open(inode, file); file->private_data = inode->i_private; return (0); } } static int batadv_log_release(struct inode *inode , struct file *file ) { { module_put(& __this_module); return (0); } } static int batadv_log_empty(struct batadv_priv_debug_log *debug_log ) { { return (debug_log->log_start == debug_log->log_end); } } static ssize_t batadv_log_read(struct file *file , char *buf , size_t count , loff_t *ppos ) { struct batadv_priv *bat_priv ; struct batadv_priv_debug_log *debug_log ; int error ; int i ; char *char_addr ; char c ; int tmp ; struct thread_info *tmp___0 ; bool tmp___1 ; int tmp___2 ; long tmp___3 ; int __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___4 ; int tmp___5 ; int tmp___6 ; int __pu_err ; { bat_priv = (struct batadv_priv *)file->private_data; debug_log = bat_priv->debug_log; i = 0; if ((file->f_flags & 2048U) != 0U) { tmp = batadv_log_empty(debug_log); if (tmp != 0) { return (-11L); } else { } } else { } if ((unsigned long )buf == (unsigned long )((char *)0)) { return (-22L); } else { } if (count == 0UL) { return (0L); } else { } tmp___0 = current_thread_info(); tmp___1 = __chk_range_not_ok((unsigned long )buf, count, tmp___0->addr_limit.seg); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } tmp___3 = ldv__builtin_expect((long )tmp___2, 1L); if (tmp___3 == 0L) { return (-14L); } else { } __ret = 0; tmp___6 = batadv_log_empty(debug_log); if (tmp___6 != 0) { __ret___0 = 0L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_50032: tmp___4 = prepare_to_wait_event(& debug_log->queue_wait, & __wait, 1); __int = tmp___4; tmp___5 = batadv_log_empty(debug_log); if (tmp___5 == 0) { goto ldv_50031; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_50031; } else { } schedule(); goto ldv_50032; ldv_50031: finish_wait(& debug_log->queue_wait, & __wait); __ret = (int )__ret___0; } else { } error = __ret; if (error != 0) { return ((ssize_t )error); } else { } spin_lock_bh(& debug_log->lock); goto ldv_50044; ldv_50043: char_addr = batadv_log_char_addr(debug_log, debug_log->log_start); c = *char_addr; debug_log->log_start = debug_log->log_start + 1UL; spin_unlock_bh(& debug_log->lock); __pu_err = 0; switch (1UL) { case 1UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovb %b1,%2\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__pu_err): "iq" (c), "m" (*((struct __large_struct *)buf)), "i" (-14), "0" (__pu_err)); goto ldv_50037; case 2UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovw %w1,%2\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__pu_err): "ir" (c), "m" (*((struct __large_struct *)buf)), "i" (-14), "0" (__pu_err)); goto ldv_50037; case 4UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovl %k1,%2\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__pu_err): "ir" (c), "m" (*((struct __large_struct *)buf)), "i" (-14), "0" (__pu_err)); goto ldv_50037; case 8UL: __asm__ volatile ("661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xcb\n6641:\n\t.popsection\n1:\tmovq %1,%2\n2: 661:\n\t.byte 0x66,0x66,0x90\n\n662:\n.pushsection .altinstructions,\"a\"\n .long 661b - .\n .long 6631f - .\n .word (9*32+20)\n .byte 662b-661b\n .byte 6641f-6631f\n.popsection\n.pushsection .discard,\"aw\",@progbits\n .byte 0xff + (6641f-6631f) - (662b-661b)\n.popsection\n.pushsection .altinstr_replacement, \"ax\"\n6631:\n\t.byte 0x0f,0x01,0xca\n6641:\n\t.popsection\n.section .fixup,\"ax\"\n3:\tmov %3,%0\n\tjmp 2b\n.previous\n .pushsection \"__ex_table\",\"a\"\n .balign 8\n .long (1b) - .\n .long (3b) - .\n .popsection\n": "=r" (__pu_err): "er" (c), "m" (*((struct __large_struct *)buf)), "i" (-14), "0" (__pu_err)); goto ldv_50037; default: __put_user_bad(); } ldv_50037: error = __pu_err; spin_lock_bh(& debug_log->lock); buf = buf + 1; i = i + 1; ldv_50044: ; if ((error == 0 && (size_t )i < count) && debug_log->log_start != debug_log->log_end) { goto ldv_50043; } else { } spin_unlock_bh(& debug_log->lock); if (error == 0) { return ((ssize_t )i); } else { } return ((ssize_t )error); } } static unsigned int batadv_log_poll(struct file *file , poll_table *wait ) { struct batadv_priv *bat_priv ; struct batadv_priv_debug_log *debug_log ; int tmp ; { bat_priv = (struct batadv_priv *)file->private_data; debug_log = bat_priv->debug_log; poll_wait(file, & debug_log->queue_wait, wait); tmp = batadv_log_empty(debug_log); if (tmp == 0) { return (65U); } else { } return (0U); } } static struct file_operations const batadv_log_fops = {0, & no_llseek, & batadv_log_read, 0, 0, 0, 0, 0, 0, & batadv_log_poll, 0, 0, 0, & batadv_log_open, 0, & batadv_log_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static int batadv_debug_log_setup(struct batadv_priv *bat_priv ) { struct dentry *d ; void *tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; { if ((unsigned long )bat_priv->debug_dir == (unsigned long )((struct dentry *)0)) { goto err; } else { } tmp = kzalloc(8368UL, 32U); bat_priv->debug_log = (struct batadv_priv_debug_log *)tmp; if ((unsigned long )bat_priv->debug_log == (unsigned long )((struct batadv_priv_debug_log *)0)) { goto err; } else { } spinlock_check(& (bat_priv->debug_log)->lock); __raw_spin_lock_init(& (bat_priv->debug_log)->lock.ldv_6347.rlock, "&(&bat_priv->debug_log->lock)->rlock", & __key); __init_waitqueue_head(& (bat_priv->debug_log)->queue_wait, "&bat_priv->debug_log->queue_wait", & __key___0); d = debugfs_create_file("log", 33024, bat_priv->debug_dir, (void *)bat_priv, & batadv_log_fops); if ((unsigned long )d == (unsigned long )((struct dentry *)0)) { goto err; } else { } return (0); err: ; return (-12); } } static void batadv_debug_log_cleanup(struct batadv_priv *bat_priv ) { { kfree((void const *)bat_priv->debug_log); bat_priv->debug_log = (struct batadv_priv_debug_log *)0; return; } } static int batadv_algorithms_open(struct inode *inode , struct file *file ) { int tmp ; { tmp = single_open(file, & batadv_algo_seq_print_text, (void *)0); return (tmp); } } static int batadv_originators_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_orig_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_originators_hardif_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_orig_hardif_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_gateways_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_gw_client_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_transtable_global_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_tt_global_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_bla_claim_table_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_bla_claim_table_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_bla_backbone_table_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_bla_backbone_table_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_dat_cache_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_dat_cache_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_transtable_local_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_tt_local_seq_print_text, (void *)net_dev); return (tmp); } } static int batadv_nc_nodes_open(struct inode *inode , struct file *file ) { struct net_device *net_dev ; int tmp ; { net_dev = (struct net_device *)inode->i_private; tmp = single_open(file, & batadv_nc_nodes_seq_print_text, (void *)net_dev); return (tmp); } } static struct batadv_debuginfo batadv_debuginfo_routing_algos = {{"routing_algos", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_algorithms_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo *batadv_general_debuginfos[2U] = { & batadv_debuginfo_routing_algos, (struct batadv_debuginfo *)0}; static struct batadv_debuginfo batadv_debuginfo_originators = {{"originators", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_originators_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo batadv_debuginfo_gateways = {{"gateways", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_gateways_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo batadv_debuginfo_transtable_global = {{"transtable_global", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_transtable_global_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo batadv_debuginfo_bla_claim_table = {{"bla_claim_table", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_bla_claim_table_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo batadv_debuginfo_bla_backbone_table = {{"bla_backbone_table", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_bla_backbone_table_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo batadv_debuginfo_dat_cache = {{"dat_cache", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_dat_cache_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo batadv_debuginfo_transtable_local = {{"transtable_local", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_transtable_local_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo batadv_debuginfo_nc_nodes = {{"nc_nodes", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_nc_nodes_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo *batadv_mesh_debuginfos[9U] = { & batadv_debuginfo_originators, & batadv_debuginfo_gateways, & batadv_debuginfo_transtable_global, & batadv_debuginfo_bla_claim_table, & batadv_debuginfo_bla_backbone_table, & batadv_debuginfo_dat_cache, & batadv_debuginfo_transtable_local, & batadv_debuginfo_nc_nodes, (struct batadv_debuginfo *)0}; static struct batadv_debuginfo batadv_hardif_debuginfo_originators = {{"originators", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {& __this_module, & seq_lseek, & seq_read, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_originators_hardif_open, 0, & single_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; static struct batadv_debuginfo *batadv_hardif_debuginfos[2U] = { & batadv_hardif_debuginfo_originators, (struct batadv_debuginfo *)0}; void batadv_debugfs_init(void) { struct batadv_debuginfo **bat_debug ; struct dentry *file ; void *tmp ; { batadv_debugfs = debugfs_create_dir("batman_adv", (struct dentry *)0); tmp = ERR_PTR(-19L); if ((unsigned long )tmp == (unsigned long )((void *)batadv_debugfs)) { batadv_debugfs = (struct dentry *)0; } else { } if ((unsigned long )batadv_debugfs == (unsigned long )((struct dentry *)0)) { goto err; } else { } bat_debug = (struct batadv_debuginfo **)(& batadv_general_debuginfos); goto ldv_50135; ldv_50134: file = debugfs_create_file((*bat_debug)->attr.name, (int )((unsigned int )(*bat_debug)->attr.mode | 32768U), batadv_debugfs, (void *)0, & (*bat_debug)->fops); if ((unsigned long )file == (unsigned long )((struct dentry *)0)) { printk("\vbatman_adv: Can\'t add general debugfs file: %s\n", (*bat_debug)->attr.name); goto err; } else { } bat_debug = bat_debug + 1; ldv_50135: ; if ((unsigned long )*bat_debug != (unsigned long )((struct batadv_debuginfo *)0)) { goto ldv_50134; } else { } return; err: debugfs_remove_recursive(batadv_debugfs); batadv_debugfs = (struct dentry *)0; return; } } void batadv_debugfs_destroy(void) { { debugfs_remove_recursive(batadv_debugfs); batadv_debugfs = (struct dentry *)0; return; } } int batadv_debugfs_add_hardif(struct batadv_hard_iface *hard_iface ) { struct batadv_debuginfo **bat_debug ; struct dentry *file ; { if ((unsigned long )batadv_debugfs == (unsigned long )((struct dentry *)0)) { goto out; } else { } hard_iface->debug_dir = debugfs_create_dir((char const *)(& (hard_iface->net_dev)->name), batadv_debugfs); if ((unsigned long )hard_iface->debug_dir == (unsigned long )((struct dentry *)0)) { goto out; } else { } bat_debug = (struct batadv_debuginfo **)(& batadv_hardif_debuginfos); goto ldv_50148; ldv_50147: file = debugfs_create_file((*bat_debug)->attr.name, (int )((unsigned int )(*bat_debug)->attr.mode | 32768U), hard_iface->debug_dir, (void *)hard_iface->net_dev, & (*bat_debug)->fops); if ((unsigned long )file == (unsigned long )((struct dentry *)0)) { goto rem_attr; } else { } bat_debug = bat_debug + 1; ldv_50148: ; if ((unsigned long )*bat_debug != (unsigned long )((struct batadv_debuginfo *)0)) { goto ldv_50147; } else { } return (0); rem_attr: debugfs_remove_recursive(hard_iface->debug_dir); hard_iface->debug_dir = (struct dentry *)0; out: ; return (-12); } } void batadv_debugfs_del_hardif(struct batadv_hard_iface *hard_iface ) { { if ((unsigned long )batadv_debugfs != (unsigned long )((struct dentry *)0)) { debugfs_remove_recursive(hard_iface->debug_dir); hard_iface->debug_dir = (struct dentry *)0; } else { } return; } } int batadv_debugfs_add_meshif(struct net_device *dev ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_debuginfo **bat_debug ; struct dentry *file ; int tmp___0 ; int tmp___1 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; if ((unsigned long )batadv_debugfs == (unsigned long )((struct dentry *)0)) { goto out; } else { } bat_priv->debug_dir = debugfs_create_dir((char const *)(& dev->name), batadv_debugfs); if ((unsigned long )bat_priv->debug_dir == (unsigned long )((struct dentry *)0)) { goto out; } else { } tmp___0 = batadv_socket_setup(bat_priv); if (tmp___0 < 0) { goto rem_attr; } else { } tmp___1 = batadv_debug_log_setup(bat_priv); if (tmp___1 < 0) { goto rem_attr; } else { } bat_debug = (struct batadv_debuginfo **)(& batadv_mesh_debuginfos); goto ldv_50164; ldv_50163: file = debugfs_create_file((*bat_debug)->attr.name, (int )((unsigned int )(*bat_debug)->attr.mode | 32768U), bat_priv->debug_dir, (void *)dev, & (*bat_debug)->fops); if ((unsigned long )file == (unsigned long )((struct dentry *)0)) { _netdev = dev; tmp___2 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___2; tmp___3 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___3 & 63) != 0) { batadv_debug_log(_batpriv, "Can\'t add debugfs file: %s/%s\n", (char *)(& dev->name), (*bat_debug)->attr.name); } else { } printk("\vbatman_adv: %s: Can\'t add debugfs file: %s/%s\n", (char *)(& _netdev->name), (char *)(& dev->name), (*bat_debug)->attr.name); goto rem_attr; } else { } bat_debug = bat_debug + 1; ldv_50164: ; if ((unsigned long )*bat_debug != (unsigned long )((struct batadv_debuginfo *)0)) { goto ldv_50163; } else { } tmp___4 = batadv_nc_init_debugfs(bat_priv); if (tmp___4 < 0) { goto rem_attr; } else { } return (0); rem_attr: debugfs_remove_recursive(bat_priv->debug_dir); bat_priv->debug_dir = (struct dentry *)0; out: ; return (-12); } } void batadv_debugfs_del_meshif(struct net_device *dev ) { struct batadv_priv *bat_priv ; void *tmp ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; batadv_debug_log_cleanup(bat_priv); if ((unsigned long )batadv_debugfs != (unsigned long )((struct dentry *)0)) { debugfs_remove_recursive(bat_priv->debug_dir); bat_priv->debug_dir = (struct dentry *)0; } else { } return; } } int ldv_retval_14 ; int ldv_retval_13 ; int ldv_retval_10 ; int ldv_retval_9 ; int ldv_retval_2 ; int ldv_retval_0 ; int ldv_retval_5 ; int ldv_retval_4 ; int ldv_retval_1 ; int ldv_retval_6 ; int ldv_retval_3 ; void ldv_initialize_batadv_debuginfo_28(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_dat_cache_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_dat_cache_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_33(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_originators_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_originators_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_30(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_bla_claim_table_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_bla_claim_table_group0 = (struct inode *)tmp___0; return; } } void ldv_file_operations_35(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(1032UL); batadv_log_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_zalloc(512UL); batadv_log_fops_group2 = (struct file *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_27(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_transtable_local_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_transtable_local_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_32(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_gateways_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_gateways_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_29(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_bla_backbone_table_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_bla_backbone_table_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_31(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_transtable_global_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_transtable_global_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_25(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_hardif_debuginfo_originators_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_hardif_debuginfo_originators_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_34(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_routing_algos_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_routing_algos_group0 = (struct inode *)tmp___0; return; } } void ldv_initialize_batadv_debuginfo_26(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(512UL); batadv_debuginfo_nc_nodes_group1 = (struct file *)tmp; tmp___0 = ldv_zalloc(1032UL); batadv_debuginfo_nc_nodes_group0 = (struct inode *)tmp___0; return; } } void ldv_main_exported_35(void) { loff_t ldvarg83 ; loff_t tmp ; size_t ldvarg86 ; size_t tmp___0 ; int ldvarg82 ; int tmp___1 ; char *ldvarg87 ; void *tmp___2 ; struct poll_table_struct *ldvarg84 ; void *tmp___3 ; loff_t *ldvarg85 ; void *tmp___4 ; int tmp___5 ; { tmp = __VERIFIER_nondet_loff_t(); ldvarg83 = tmp; tmp___0 = __VERIFIER_nondet_size_t(); ldvarg86 = tmp___0; tmp___1 = __VERIFIER_nondet_int(); ldvarg82 = tmp___1; tmp___2 = ldv_zalloc(1UL); ldvarg87 = (char *)tmp___2; tmp___3 = ldv_zalloc(16UL); ldvarg84 = (struct poll_table_struct *)tmp___3; tmp___4 = ldv_zalloc(8UL); ldvarg85 = (loff_t *)tmp___4; tmp___5 = __VERIFIER_nondet_int(); switch (tmp___5) { case 0: ; if (ldv_state_variable_35 == 2) { batadv_log_read(batadv_log_fops_group2, ldvarg87, ldvarg86, ldvarg85); ldv_state_variable_35 = 2; } else { } goto ldv_50224; case 1: ; if (ldv_state_variable_35 == 1) { batadv_log_poll(batadv_log_fops_group2, ldvarg84); ldv_state_variable_35 = 1; } else { } if (ldv_state_variable_35 == 2) { batadv_log_poll(batadv_log_fops_group2, ldvarg84); ldv_state_variable_35 = 2; } else { } goto ldv_50224; case 2: ; if (ldv_state_variable_35 == 1) { ldv_retval_10 = batadv_log_open(batadv_log_fops_group1, batadv_log_fops_group2); if (ldv_retval_10 == 0) { ldv_state_variable_35 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50224; case 3: ; if (ldv_state_variable_35 == 2) { batadv_log_release(batadv_log_fops_group1, batadv_log_fops_group2); ldv_state_variable_35 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50224; case 4: ; if (ldv_state_variable_35 == 2) { no_llseek(batadv_log_fops_group2, ldvarg83, ldvarg82); ldv_state_variable_35 = 2; } else { } goto ldv_50224; default: ldv_stop(); } ldv_50224: ; return; } } void ldv_main_exported_27(void) { int ldvarg46 ; int tmp ; loff_t ldvarg47 ; loff_t tmp___0 ; char *ldvarg50 ; void *tmp___1 ; size_t ldvarg49 ; size_t tmp___2 ; loff_t *ldvarg48 ; void *tmp___3 ; int tmp___4 ; { tmp = __VERIFIER_nondet_int(); ldvarg46 = tmp; tmp___0 = __VERIFIER_nondet_loff_t(); ldvarg47 = tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg50 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_size_t(); ldvarg49 = tmp___2; tmp___3 = ldv_zalloc(8UL); ldvarg48 = (loff_t *)tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_27 == 2) { seq_read(batadv_debuginfo_transtable_local_group1, ldvarg50, ldvarg49, ldvarg48); ldv_state_variable_27 = 2; } else { } goto ldv_50239; case 1: ; if (ldv_state_variable_27 == 1) { ldv_retval_4 = batadv_transtable_local_open(batadv_debuginfo_transtable_local_group0, batadv_debuginfo_transtable_local_group1); if (ldv_retval_4 == 0) { ldv_state_variable_27 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50239; case 2: ; if (ldv_state_variable_27 == 2) { single_release(batadv_debuginfo_transtable_local_group0, batadv_debuginfo_transtable_local_group1); ldv_state_variable_27 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50239; case 3: ; if (ldv_state_variable_27 == 1) { seq_lseek(batadv_debuginfo_transtable_local_group1, ldvarg47, ldvarg46); ldv_state_variable_27 = 1; } else { } if (ldv_state_variable_27 == 2) { seq_lseek(batadv_debuginfo_transtable_local_group1, ldvarg47, ldvarg46); ldv_state_variable_27 = 2; } else { } goto ldv_50239; default: ldv_stop(); } ldv_50239: ; return; } } void ldv_main_exported_25(void) { loff_t ldvarg52 ; loff_t tmp ; char *ldvarg55 ; void *tmp___0 ; loff_t *ldvarg53 ; void *tmp___1 ; int ldvarg51 ; int tmp___2 ; size_t ldvarg54 ; size_t tmp___3 ; int tmp___4 ; { tmp = __VERIFIER_nondet_loff_t(); ldvarg52 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg55 = (char *)tmp___0; tmp___1 = ldv_zalloc(8UL); ldvarg53 = (loff_t *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); ldvarg51 = tmp___2; tmp___3 = __VERIFIER_nondet_size_t(); ldvarg54 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_25 == 2) { seq_read(batadv_hardif_debuginfo_originators_group1, ldvarg55, ldvarg54, ldvarg53); ldv_state_variable_25 = 2; } else { } goto ldv_50253; case 1: ; if (ldv_state_variable_25 == 1) { ldv_retval_5 = batadv_originators_hardif_open(batadv_hardif_debuginfo_originators_group0, batadv_hardif_debuginfo_originators_group1); if (ldv_retval_5 == 0) { ldv_state_variable_25 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50253; case 2: ; if (ldv_state_variable_25 == 2) { single_release(batadv_hardif_debuginfo_originators_group0, batadv_hardif_debuginfo_originators_group1); ldv_state_variable_25 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50253; case 3: ; if (ldv_state_variable_25 == 1) { seq_lseek(batadv_hardif_debuginfo_originators_group1, ldvarg52, ldvarg51); ldv_state_variable_25 = 1; } else { } if (ldv_state_variable_25 == 2) { seq_lseek(batadv_hardif_debuginfo_originators_group1, ldvarg52, ldvarg51); ldv_state_variable_25 = 2; } else { } goto ldv_50253; default: ldv_stop(); } ldv_50253: ; return; } } void ldv_main_exported_33(void) { loff_t *ldvarg2 ; void *tmp ; int ldvarg0 ; int tmp___0 ; size_t ldvarg3 ; size_t tmp___1 ; char *ldvarg4 ; void *tmp___2 ; loff_t ldvarg1 ; loff_t tmp___3 ; int tmp___4 ; { tmp = ldv_zalloc(8UL); ldvarg2 = (loff_t *)tmp; tmp___0 = __VERIFIER_nondet_int(); ldvarg0 = tmp___0; tmp___1 = __VERIFIER_nondet_size_t(); ldvarg3 = tmp___1; tmp___2 = ldv_zalloc(1UL); ldvarg4 = (char *)tmp___2; tmp___3 = __VERIFIER_nondet_loff_t(); ldvarg1 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_33 == 2) { seq_read(batadv_debuginfo_originators_group1, ldvarg4, ldvarg3, ldvarg2); ldv_state_variable_33 = 2; } else { } goto ldv_50267; case 1: ; if (ldv_state_variable_33 == 1) { ldv_retval_0 = batadv_originators_open(batadv_debuginfo_originators_group0, batadv_debuginfo_originators_group1); if (ldv_retval_0 == 0) { ldv_state_variable_33 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50267; case 2: ; if (ldv_state_variable_33 == 2) { single_release(batadv_debuginfo_originators_group0, batadv_debuginfo_originators_group1); ldv_state_variable_33 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50267; case 3: ; if (ldv_state_variable_33 == 1) { seq_lseek(batadv_debuginfo_originators_group1, ldvarg1, ldvarg0); ldv_state_variable_33 = 1; } else { } if (ldv_state_variable_33 == 2) { seq_lseek(batadv_debuginfo_originators_group1, ldvarg1, ldvarg0); ldv_state_variable_33 = 2; } else { } goto ldv_50267; default: ldv_stop(); } ldv_50267: ; return; } } void ldv_main_exported_32(void) { loff_t ldvarg6 ; loff_t tmp ; int ldvarg5 ; int tmp___0 ; char *ldvarg9 ; void *tmp___1 ; loff_t *ldvarg7 ; void *tmp___2 ; size_t ldvarg8 ; size_t tmp___3 ; int tmp___4 ; { tmp = __VERIFIER_nondet_loff_t(); ldvarg6 = tmp; tmp___0 = __VERIFIER_nondet_int(); ldvarg5 = tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg9 = (char *)tmp___1; tmp___2 = ldv_zalloc(8UL); ldvarg7 = (loff_t *)tmp___2; tmp___3 = __VERIFIER_nondet_size_t(); ldvarg8 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_32 == 2) { seq_read(batadv_debuginfo_gateways_group1, ldvarg9, ldvarg8, ldvarg7); ldv_state_variable_32 = 2; } else { } goto ldv_50281; case 1: ; if (ldv_state_variable_32 == 1) { ldv_retval_1 = batadv_gateways_open(batadv_debuginfo_gateways_group0, batadv_debuginfo_gateways_group1); if (ldv_retval_1 == 0) { ldv_state_variable_32 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50281; case 2: ; if (ldv_state_variable_32 == 2) { single_release(batadv_debuginfo_gateways_group0, batadv_debuginfo_gateways_group1); ldv_state_variable_32 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50281; case 3: ; if (ldv_state_variable_32 == 1) { seq_lseek(batadv_debuginfo_gateways_group1, ldvarg6, ldvarg5); ldv_state_variable_32 = 1; } else { } if (ldv_state_variable_32 == 2) { seq_lseek(batadv_debuginfo_gateways_group1, ldvarg6, ldvarg5); ldv_state_variable_32 = 2; } else { } goto ldv_50281; default: ldv_stop(); } ldv_50281: ; return; } } void ldv_main_exported_28(void) { int ldvarg56 ; int tmp ; size_t ldvarg59 ; size_t tmp___0 ; char *ldvarg60 ; void *tmp___1 ; loff_t *ldvarg58 ; void *tmp___2 ; loff_t ldvarg57 ; loff_t tmp___3 ; int tmp___4 ; { tmp = __VERIFIER_nondet_int(); ldvarg56 = tmp; tmp___0 = __VERIFIER_nondet_size_t(); ldvarg59 = tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg60 = (char *)tmp___1; tmp___2 = ldv_zalloc(8UL); ldvarg58 = (loff_t *)tmp___2; tmp___3 = __VERIFIER_nondet_loff_t(); ldvarg57 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_28 == 2) { seq_read(batadv_debuginfo_dat_cache_group1, ldvarg60, ldvarg59, ldvarg58); ldv_state_variable_28 = 2; } else { } goto ldv_50295; case 1: ; if (ldv_state_variable_28 == 1) { ldv_retval_6 = batadv_dat_cache_open(batadv_debuginfo_dat_cache_group0, batadv_debuginfo_dat_cache_group1); if (ldv_retval_6 == 0) { ldv_state_variable_28 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50295; case 2: ; if (ldv_state_variable_28 == 2) { single_release(batadv_debuginfo_dat_cache_group0, batadv_debuginfo_dat_cache_group1); ldv_state_variable_28 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50295; case 3: ; if (ldv_state_variable_28 == 1) { seq_lseek(batadv_debuginfo_dat_cache_group1, ldvarg57, ldvarg56); ldv_state_variable_28 = 1; } else { } if (ldv_state_variable_28 == 2) { seq_lseek(batadv_debuginfo_dat_cache_group1, ldvarg57, ldvarg56); ldv_state_variable_28 = 2; } else { } goto ldv_50295; default: ldv_stop(); } ldv_50295: ; return; } } void ldv_main_exported_26(void) { loff_t ldvarg22 ; loff_t tmp ; loff_t *ldvarg23 ; void *tmp___0 ; char *ldvarg25 ; void *tmp___1 ; int ldvarg21 ; int tmp___2 ; size_t ldvarg24 ; size_t tmp___3 ; int tmp___4 ; { tmp = __VERIFIER_nondet_loff_t(); ldvarg22 = tmp; tmp___0 = ldv_zalloc(8UL); ldvarg23 = (loff_t *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg25 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); ldvarg21 = tmp___2; tmp___3 = __VERIFIER_nondet_size_t(); ldvarg24 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_26 == 2) { seq_read(batadv_debuginfo_nc_nodes_group1, ldvarg25, ldvarg24, ldvarg23); ldv_state_variable_26 = 2; } else { } goto ldv_50309; case 1: ; if (ldv_state_variable_26 == 1) { ldv_retval_2 = batadv_nc_nodes_open(batadv_debuginfo_nc_nodes_group0, batadv_debuginfo_nc_nodes_group1); if (ldv_retval_2 == 0) { ldv_state_variable_26 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50309; case 2: ; if (ldv_state_variable_26 == 2) { single_release(batadv_debuginfo_nc_nodes_group0, batadv_debuginfo_nc_nodes_group1); ldv_state_variable_26 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50309; case 3: ; if (ldv_state_variable_26 == 1) { seq_lseek(batadv_debuginfo_nc_nodes_group1, ldvarg22, ldvarg21); ldv_state_variable_26 = 1; } else { } if (ldv_state_variable_26 == 2) { seq_lseek(batadv_debuginfo_nc_nodes_group1, ldvarg22, ldvarg21); ldv_state_variable_26 = 2; } else { } goto ldv_50309; default: ldv_stop(); } ldv_50309: ; return; } } void ldv_main_exported_34(void) { loff_t *ldvarg139 ; void *tmp ; char *ldvarg141 ; void *tmp___0 ; int ldvarg137 ; int tmp___1 ; size_t ldvarg140 ; size_t tmp___2 ; loff_t ldvarg138 ; loff_t tmp___3 ; int tmp___4 ; { tmp = ldv_zalloc(8UL); ldvarg139 = (loff_t *)tmp; tmp___0 = ldv_zalloc(1UL); ldvarg141 = (char *)tmp___0; tmp___1 = __VERIFIER_nondet_int(); ldvarg137 = tmp___1; tmp___2 = __VERIFIER_nondet_size_t(); ldvarg140 = tmp___2; tmp___3 = __VERIFIER_nondet_loff_t(); ldvarg138 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_34 == 2) { seq_read(batadv_debuginfo_routing_algos_group1, ldvarg141, ldvarg140, ldvarg139); ldv_state_variable_34 = 2; } else { } goto ldv_50323; case 1: ; if (ldv_state_variable_34 == 1) { ldv_retval_14 = batadv_algorithms_open(batadv_debuginfo_routing_algos_group0, batadv_debuginfo_routing_algos_group1); if (ldv_retval_14 == 0) { ldv_state_variable_34 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50323; case 2: ; if (ldv_state_variable_34 == 2) { single_release(batadv_debuginfo_routing_algos_group0, batadv_debuginfo_routing_algos_group1); ldv_state_variable_34 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50323; case 3: ; if (ldv_state_variable_34 == 1) { seq_lseek(batadv_debuginfo_routing_algos_group1, ldvarg138, ldvarg137); ldv_state_variable_34 = 1; } else { } if (ldv_state_variable_34 == 2) { seq_lseek(batadv_debuginfo_routing_algos_group1, ldvarg138, ldvarg137); ldv_state_variable_34 = 2; } else { } goto ldv_50323; default: ldv_stop(); } ldv_50323: ; return; } } void ldv_main_exported_30(void) { int ldvarg38 ; int tmp ; loff_t *ldvarg40 ; void *tmp___0 ; char *ldvarg42 ; void *tmp___1 ; size_t ldvarg41 ; size_t tmp___2 ; loff_t ldvarg39 ; loff_t tmp___3 ; int tmp___4 ; { tmp = __VERIFIER_nondet_int(); ldvarg38 = tmp; tmp___0 = ldv_zalloc(8UL); ldvarg40 = (loff_t *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg42 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_size_t(); ldvarg41 = tmp___2; tmp___3 = __VERIFIER_nondet_loff_t(); ldvarg39 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_30 == 2) { seq_read(batadv_debuginfo_bla_claim_table_group1, ldvarg42, ldvarg41, ldvarg40); ldv_state_variable_30 = 2; } else { } goto ldv_50337; case 1: ; if (ldv_state_variable_30 == 1) { ldv_retval_3 = batadv_bla_claim_table_open(batadv_debuginfo_bla_claim_table_group0, batadv_debuginfo_bla_claim_table_group1); if (ldv_retval_3 == 0) { ldv_state_variable_30 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50337; case 2: ; if (ldv_state_variable_30 == 2) { single_release(batadv_debuginfo_bla_claim_table_group0, batadv_debuginfo_bla_claim_table_group1); ldv_state_variable_30 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50337; case 3: ; if (ldv_state_variable_30 == 1) { seq_lseek(batadv_debuginfo_bla_claim_table_group1, ldvarg39, ldvarg38); ldv_state_variable_30 = 1; } else { } if (ldv_state_variable_30 == 2) { seq_lseek(batadv_debuginfo_bla_claim_table_group1, ldvarg39, ldvarg38); ldv_state_variable_30 = 2; } else { } goto ldv_50337; default: ldv_stop(); } ldv_50337: ; return; } } void ldv_main_exported_29(void) { char *ldvarg109 ; void *tmp ; loff_t *ldvarg107 ; void *tmp___0 ; int ldvarg105 ; int tmp___1 ; loff_t ldvarg106 ; loff_t tmp___2 ; size_t ldvarg108 ; size_t tmp___3 ; int tmp___4 ; { tmp = ldv_zalloc(1UL); ldvarg109 = (char *)tmp; tmp___0 = ldv_zalloc(8UL); ldvarg107 = (loff_t *)tmp___0; tmp___1 = __VERIFIER_nondet_int(); ldvarg105 = tmp___1; tmp___2 = __VERIFIER_nondet_loff_t(); ldvarg106 = tmp___2; tmp___3 = __VERIFIER_nondet_size_t(); ldvarg108 = tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_29 == 2) { seq_read(batadv_debuginfo_bla_backbone_table_group1, ldvarg109, ldvarg108, ldvarg107); ldv_state_variable_29 = 2; } else { } goto ldv_50351; case 1: ; if (ldv_state_variable_29 == 1) { ldv_retval_13 = batadv_bla_backbone_table_open(batadv_debuginfo_bla_backbone_table_group0, batadv_debuginfo_bla_backbone_table_group1); if (ldv_retval_13 == 0) { ldv_state_variable_29 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50351; case 2: ; if (ldv_state_variable_29 == 2) { single_release(batadv_debuginfo_bla_backbone_table_group0, batadv_debuginfo_bla_backbone_table_group1); ldv_state_variable_29 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50351; case 3: ; if (ldv_state_variable_29 == 1) { seq_lseek(batadv_debuginfo_bla_backbone_table_group1, ldvarg106, ldvarg105); ldv_state_variable_29 = 1; } else { } if (ldv_state_variable_29 == 2) { seq_lseek(batadv_debuginfo_bla_backbone_table_group1, ldvarg106, ldvarg105); ldv_state_variable_29 = 2; } else { } goto ldv_50351; default: ldv_stop(); } ldv_50351: ; return; } } void ldv_main_exported_31(void) { loff_t ldvarg78 ; loff_t tmp ; size_t ldvarg80 ; size_t tmp___0 ; loff_t *ldvarg79 ; void *tmp___1 ; int ldvarg77 ; int tmp___2 ; char *ldvarg81 ; void *tmp___3 ; int tmp___4 ; { tmp = __VERIFIER_nondet_loff_t(); ldvarg78 = tmp; tmp___0 = __VERIFIER_nondet_size_t(); ldvarg80 = tmp___0; tmp___1 = ldv_zalloc(8UL); ldvarg79 = (loff_t *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); ldvarg77 = tmp___2; tmp___3 = ldv_zalloc(1UL); ldvarg81 = (char *)tmp___3; tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_31 == 2) { seq_read(batadv_debuginfo_transtable_global_group1, ldvarg81, ldvarg80, ldvarg79); ldv_state_variable_31 = 2; } else { } goto ldv_50365; case 1: ; if (ldv_state_variable_31 == 1) { ldv_retval_9 = batadv_transtable_global_open(batadv_debuginfo_transtable_global_group0, batadv_debuginfo_transtable_global_group1); if (ldv_retval_9 == 0) { ldv_state_variable_31 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50365; case 2: ; if (ldv_state_variable_31 == 2) { single_release(batadv_debuginfo_transtable_global_group0, batadv_debuginfo_transtable_global_group1); ldv_state_variable_31 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50365; case 3: ; if (ldv_state_variable_31 == 1) { seq_lseek(batadv_debuginfo_transtable_global_group1, ldvarg78, ldvarg77); ldv_state_variable_31 = 1; } else { } if (ldv_state_variable_31 == 2) { seq_lseek(batadv_debuginfo_transtable_global_group1, ldvarg78, ldvarg77); ldv_state_variable_31 = 2; } else { } goto ldv_50365; default: ldv_stop(); } ldv_50365: ; return; } } void *ldv_kmem_cache_alloc_152(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_158(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_160(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_162(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_163(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_164(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_165(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_166(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_167(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_168(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_169(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_196(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_213(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_204(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_212(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_206(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; extern struct sk_buff *__pskb_copy_fclone(struct sk_buff * , int , gfp_t , bool ) ; int ldv_pskb_expand_head_202(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_210(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_211(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_207(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_208(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_209(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *pskb_copy_for_clone(struct sk_buff *skb , gfp_t gfp_mask ) { unsigned int tmp ; struct sk_buff *tmp___0 ; { tmp = skb_headroom((struct sk_buff const *)skb); tmp___0 = __pskb_copy_fclone(skb, (int )tmp, gfp_mask, 1); return (tmp___0); } } __inline static int __skb_cow___0(struct sk_buff *skb , unsigned int headroom , int cloned ) { int delta ; unsigned int tmp ; unsigned int tmp___0 ; int _max1 ; int _max2 ; int _max1___0 ; int _max2___0 ; int tmp___1 ; { delta = 0; tmp___0 = skb_headroom((struct sk_buff const *)skb); if (tmp___0 < headroom) { tmp = skb_headroom((struct sk_buff const *)skb); delta = (int )(headroom - tmp); } else { } if (delta != 0 || cloned != 0) { _max1 = 32; _max2 = 64; _max1___0 = 32; _max2___0 = 64; tmp___1 = ldv_pskb_expand_head_210(skb, (((_max1 > _max2 ? _max1 : _max2) + -1) + delta) & - (_max1___0 > _max2___0 ? _max1___0 : _max2___0), 0, 32U); return (tmp___1); } else { } return (0); } } __inline static int skb_cow_head___0(struct sk_buff *skb , unsigned int headroom ) { int tmp ; int tmp___0 ; { tmp = skb_header_cloned((struct sk_buff const *)skb); tmp___0 = __skb_cow___0(skb, headroom, tmp); return (tmp___0); } } __inline static bool ipv4_is_loopback(__be32 addr ) { { return ((addr & 255U) == 127U); } } __inline static bool ipv4_is_multicast(__be32 addr ) { { return ((addr & 240U) == 224U); } } __inline static bool ipv4_is_lbcast(__be32 addr ) { { return (addr == 4294967295U); } } __inline static bool ipv4_is_zeronet(__be32 addr ) { { return ((addr & 255U) == 0U); } } __inline static bool is_zero_ether_addr(u8 const *addr ) { { return (((unsigned int )*((u32 const *)addr) | (unsigned int )*((u16 const *)addr + 4U)) == 0U); } } __inline static struct sk_buff *vlan_insert_tag___0(struct sk_buff *skb , __be16 vlan_proto , u16 vlan_tci ) { struct vlan_ethhdr *veth ; int tmp ; unsigned char *tmp___0 ; __u16 tmp___1 ; { tmp = skb_cow_head___0(skb, 4U); if (tmp < 0) { dev_kfree_skb_any(skb); return ((struct sk_buff *)0); } else { } tmp___0 = skb_push(skb, 4U); veth = (struct vlan_ethhdr *)tmp___0; memmove((void *)skb->data, (void const *)skb->data + 4U, 12UL); skb->mac_header = (unsigned int )skb->mac_header + 65532U; veth->h_vlan_proto = vlan_proto; tmp___1 = __fswab16((int )vlan_tci); veth->h_vlan_TCI = tmp___1; return (skb); } } __inline static void batadv_add_counter___1(struct batadv_priv *bat_priv , size_t idx , size_t count ) { void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; { __vpp_verify = (void const *)0; switch (8UL) { case 1UL: pao_ID__ = 0; switch (8UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49314; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49314; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49314; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49314; default: __bad_percpu_size(); } ldv_49314: ; goto ldv_49319; case 2UL: pao_ID_____0 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49325; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49325; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49325; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49325; default: __bad_percpu_size(); } ldv_49325: ; goto ldv_49319; case 4UL: pao_ID_____1 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49335; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49335; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49335; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49335; default: __bad_percpu_size(); } ldv_49335: ; goto ldv_49319; case 8UL: pao_ID_____2 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49345; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49345; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49345; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49345; default: __bad_percpu_size(); } ldv_49345: ; goto ldv_49319; default: __bad_size_call_parameter(); goto ldv_49319; } ldv_49319: ; return; } } void batadv_tvlv_container_register(struct batadv_priv *bat_priv , uint8_t type , uint8_t version , void *tvlv_value , uint16_t tvlv_value_len ) ; void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv , uint8_t type , uint8_t version ) ; void batadv_tvlv_handler_register(struct batadv_priv *bat_priv , void (*optr)(struct batadv_priv * , struct batadv_orig_node * , uint8_t , void * , uint16_t ) , int (*uptr)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ) , uint8_t type , uint8_t version , uint8_t flags ) ; void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv , uint8_t type , uint8_t version ) ; __inline static uint32_t batadv_hash_bytes___0(uint32_t hash , void const *data , uint32_t size ) { unsigned char const *key ; int i ; { key = (unsigned char const *)data; i = 0; goto ldv_49471; ldv_49470: hash = (uint32_t )*(key + (unsigned long )i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1; ldv_49471: ; if ((uint32_t )i < size) { goto ldv_49470; } else { } return (hash); } } __inline static int batadv_hash_add___1(struct batadv_hashtable *hash , int (*compare)(struct hlist_node const * , void const * ) , uint32_t (*choose)(void const * , uint32_t ) , void const *data , struct hlist_node *data_node ) { uint32_t index ; int ret ; struct hlist_head *head ; struct hlist_node *node ; spinlock_t *list_lock ; int tmp ; { ret = -1; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { goto out; } else { } index = (*choose)(data, hash->size); head = hash->table + (unsigned long )index; list_lock = hash->list_locks + (unsigned long )index; spin_lock_bh(list_lock); node = head->first; goto ldv_49489; ldv_49488: tmp = (*compare)((struct hlist_node const *)node, data); if (tmp == 0) { goto ldv_49486; } else { } ret = 1; goto unlock; ldv_49486: node = node->next; ldv_49489: ; if ((unsigned long )node != (unsigned long )((struct hlist_node *)0)) { goto ldv_49488; } else { } hlist_add_head_rcu(data_node, head); ret = 0; unlock: spin_unlock_bh(list_lock); out: ; return (ret); } } void batadv_dat_status_update(struct net_device *net_dev ) ; bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv , struct sk_buff *skb ) ; bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_size ) ; void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv , struct sk_buff *skb ) ; bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_size ) ; bool batadv_dat_drop_broadcast_packet(struct batadv_priv *bat_priv , struct batadv_forw_packet *forw_packet ) ; int batadv_dat_init(struct batadv_priv *bat_priv ) ; void batadv_dat_free(struct batadv_priv *bat_priv ) ; bool batadv_send_skb_prepare_unicast_4addr(struct batadv_priv *bat_priv , struct sk_buff *skb , struct batadv_orig_node *orig , int packet_subtype ) ; int batadv_send_skb_via_tt_generic(struct batadv_priv *bat_priv , struct sk_buff *skb , int packet_type , int packet_subtype , uint8_t *dst_hint , unsigned short vid ) ; __inline static int batadv_send_skb_via_tt(struct batadv_priv *bat_priv , struct sk_buff *skb , uint8_t *dst_hint , unsigned short vid ) { int tmp ; { tmp = batadv_send_skb_via_tt_generic(bat_priv, skb, 64, 0, dst_hint, (int )vid); return (tmp); } } __inline static int batadv_send_skb_via_tt_4addr(struct batadv_priv *bat_priv , struct sk_buff *skb , int packet_subtype , uint8_t *dst_hint , unsigned short vid ) { int tmp ; { tmp = batadv_send_skb_via_tt_generic(bat_priv, skb, 66, packet_subtype, dst_hint, (int )vid); return (tmp); } } bool batadv_is_my_client(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) ; static void batadv_dat_purge(struct work_struct *work ) ; static void batadv_dat_start_timer(struct batadv_priv *bat_priv ) { struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___0 ; unsigned long tmp ; { __init_work(& bat_priv->dat.work.work, 0); __constr_expr_0.counter = 137438953408L; bat_priv->dat.work.work.data = __constr_expr_0; lockdep_init_map(& bat_priv->dat.work.work.lockdep_map, "(&(&bat_priv->dat.work)->work)", & __key, 0); INIT_LIST_HEAD(& bat_priv->dat.work.work.entry); bat_priv->dat.work.work.func = & batadv_dat_purge; init_timer_key(& bat_priv->dat.work.timer, 2U, "(&(&bat_priv->dat.work)->timer)", & __key___0); bat_priv->dat.work.timer.function = & delayed_work_timer_fn; bat_priv->dat.work.timer.data = (unsigned long )(& bat_priv->dat.work); tmp = msecs_to_jiffies(10000U); queue_delayed_work(batadv_event_workqueue, & bat_priv->dat.work, tmp); return; } } static void batadv_dat_entry_free_ref(struct batadv_dat_entry *dat_entry ) { int tmp ; { tmp = atomic_dec_and_test(& dat_entry->refcount); if (tmp != 0) { kfree_call_rcu(& dat_entry->rcu, (void (*)(struct callback_head * ))48); } else { } return; } } static bool batadv_dat_to_purge(struct batadv_dat_entry *dat_entry ) { bool tmp ; { tmp = batadv_has_timed_out(dat_entry->last_update, 300000U); return (tmp); } } static void __batadv_dat_purge(struct batadv_priv *bat_priv , bool (*to_purge)(struct batadv_dat_entry * ) ) { spinlock_t *list_lock ; struct batadv_dat_entry *dat_entry ; struct hlist_node *node_tmp ; struct hlist_head *head ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_dat_entry *tmp ; bool tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_dat_entry *tmp___2 ; { if ((unsigned long )bat_priv->dat.hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0U; goto ldv_49860; ldv_49859: head = (bat_priv->dat.hash)->table + (unsigned long )i; list_lock = (bat_priv->dat.hash)->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_dat_entry *)__mptr + 0xffffffffffffffe8UL; } else { tmp = (struct batadv_dat_entry *)0; } dat_entry = tmp; goto ldv_49857; ldv_49856: ; if ((unsigned long )to_purge != (unsigned long )((bool (*)(struct batadv_dat_entry * ))0)) { tmp___0 = (*to_purge)(dat_entry); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_49855; } else { } } else { } hlist_del_rcu(& dat_entry->hash_entry); batadv_dat_entry_free_ref(dat_entry); ldv_49855: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_dat_entry *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___2 = (struct batadv_dat_entry *)0; } dat_entry = tmp___2; ldv_49857: ; if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { node_tmp = dat_entry->hash_entry.next; goto ldv_49856; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_49860: ; if ((bat_priv->dat.hash)->size > i) { goto ldv_49859; } else { } return; } } static void batadv_dat_purge(struct work_struct *work ) { struct delayed_work *delayed_work ; struct batadv_priv_dat *priv_dat ; struct batadv_priv *bat_priv ; struct work_struct const *__mptr ; struct delayed_work const *__mptr___0 ; struct batadv_priv_dat const *__mptr___1 ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; priv_dat = (struct batadv_priv_dat *)__mptr___0 + 0xfffffffffffffff0UL; __mptr___1 = (struct batadv_priv_dat const *)priv_dat; bat_priv = (struct batadv_priv *)__mptr___1 + 0xfffffffffffff610UL; __batadv_dat_purge(bat_priv, & batadv_dat_to_purge); batadv_dat_start_timer(bat_priv); return; } } static int batadv_compare_dat(struct hlist_node const *node , void const *data2 ) { void const *data1 ; struct hlist_node const *__mptr ; int tmp ; { __mptr = node; data1 = (void const *)((struct batadv_dat_entry *)__mptr + 0xffffffffffffffe8UL); tmp = memcmp(data1, data2, 4UL); return (tmp == 0); } } static uint8_t *batadv_arp_hw_src(struct sk_buff *skb , int hdr_size ) { uint8_t *addr ; { addr = skb->data + (unsigned long )hdr_size; addr = addr + 22UL; return (addr); } } static __be32 batadv_arp_ip_src(struct sk_buff *skb , int hdr_size ) { uint8_t *tmp ; { tmp = batadv_arp_hw_src(skb, hdr_size); return (*((__be32 *)tmp + 6U)); } } static uint8_t *batadv_arp_hw_dst(struct sk_buff *skb , int hdr_size ) { uint8_t *tmp ; { tmp = batadv_arp_hw_src(skb, hdr_size); return (tmp + 10U); } } static __be32 batadv_arp_ip_dst(struct sk_buff *skb , int hdr_size ) { uint8_t *tmp ; { tmp = batadv_arp_hw_src(skb, hdr_size); return (*((__be32 *)tmp + 16U)); } } static uint32_t batadv_hash_dat(void const *data , uint32_t size ) { uint32_t hash ; struct batadv_dat_entry const *dat ; { hash = 0U; dat = (struct batadv_dat_entry const *)data; hash = batadv_hash_bytes___0(hash, (void const *)(& dat->ip), 4U); hash = batadv_hash_bytes___0(hash, (void const *)(& dat->vid), 2U); hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } static struct batadv_dat_entry *batadv_dat_entry_hash_find(struct batadv_priv *bat_priv , __be32 ip , unsigned short vid ) { struct hlist_head *head ; struct batadv_dat_entry to_find ; struct batadv_dat_entry *dat_entry ; struct batadv_dat_entry *dat_entry_tmp ; struct batadv_hashtable *hash ; uint32_t index ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_dat_entry *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_dat_entry *tmp___3 ; { dat_entry_tmp = (struct batadv_dat_entry *)0; hash = bat_priv->dat.hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_dat_entry *)0); } else { } to_find.ip = ip; to_find.vid = vid; index = batadv_hash_dat((void const *)(& to_find), hash->size); head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_dat_entry *)__mptr + 0xffffffffffffffe8UL; } else { tmp___0 = (struct batadv_dat_entry *)0; } dat_entry = tmp___0; goto ldv_49938; ldv_49937: ; if (dat_entry->ip != ip) { goto ldv_49935; } else { } tmp___1 = atomic_add_unless(& dat_entry->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_49935; } else { } dat_entry_tmp = dat_entry; goto ldv_49936; ldv_49935: _________p1___0 = *((struct hlist_node * volatile *)(& dat_entry->hash_entry.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_dat_entry *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___3 = (struct batadv_dat_entry *)0; } dat_entry = tmp___3; ldv_49938: ; if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { goto ldv_49937; } else { } ldv_49936: rcu_read_unlock(); return (dat_entry_tmp); } } static void batadv_dat_entry_add(struct batadv_priv *bat_priv , __be32 ip , uint8_t *mac_addr , unsigned short vid ) { struct batadv_dat_entry *dat_entry ; int hash_added ; int tmp ; int tmp___0 ; void *tmp___1 ; long tmp___2 ; int tmp___3 ; { dat_entry = batadv_dat_entry_hash_find(bat_priv, ip, (int )vid); if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { tmp = batadv_compare_eth((void const *)(& dat_entry->mac_addr), (void const *)mac_addr); if (tmp == 0) { ether_addr_copy((u8 *)(& dat_entry->mac_addr), (u8 const *)mac_addr); } else { } dat_entry->last_update = jiffies; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 16) != 0) { batadv_debug_log(bat_priv, "Entry updated: %pI4 %pM (vid: %d)\n", & dat_entry->ip, (uint8_t *)(& dat_entry->mac_addr), (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } goto out; } else { } tmp___1 = kmalloc(64UL, 32U); dat_entry = (struct batadv_dat_entry *)tmp___1; if ((unsigned long )dat_entry == (unsigned long )((struct batadv_dat_entry *)0)) { goto out; } else { } dat_entry->ip = ip; dat_entry->vid = vid; ether_addr_copy((u8 *)(& dat_entry->mac_addr), (u8 const *)mac_addr); dat_entry->last_update = jiffies; atomic_set(& dat_entry->refcount, 2); hash_added = batadv_hash_add___1(bat_priv->dat.hash, & batadv_compare_dat, & batadv_hash_dat, (void const *)dat_entry, & dat_entry->hash_entry); tmp___2 = ldv__builtin_expect(hash_added != 0, 0L); if (tmp___2 != 0L) { batadv_dat_entry_free_ref(dat_entry); goto out; } else { } tmp___3 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___3 & 16) != 0) { batadv_debug_log(bat_priv, "New entry added: %pI4 %pM (vid: %d)\n", & dat_entry->ip, (uint8_t *)(& dat_entry->mac_addr), (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } out: ; if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { batadv_dat_entry_free_ref(dat_entry); } else { } return; } } static void batadv_dbg_arp(struct batadv_priv *bat_priv , struct sk_buff *skb , uint16_t type , int hdr_size , char *msg ) { struct batadv_unicast_4addr_packet *unicast_4addr_packet ; struct batadv_bcast_packet *bcast_pkt ; uint8_t *orig_addr ; __be32 ip_src ; __be32 ip_dst ; int tmp ; uint8_t *tmp___0 ; uint8_t *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; { if ((unsigned long )msg != (unsigned long )((char *)0)) { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 16) != 0) { batadv_debug_log(bat_priv, "%s\n", msg); } else { } } else { } ip_src = batadv_arp_ip_src(skb, hdr_size); ip_dst = batadv_arp_ip_dst(skb, hdr_size); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 16) != 0) { tmp___0 = batadv_arp_hw_dst(skb, hdr_size); tmp___1 = batadv_arp_hw_src(skb, hdr_size); batadv_debug_log(bat_priv, "ARP MSG = [src: %pM-%pI4 dst: %pM-%pI4]\n", tmp___1, & ip_src, tmp___0, & ip_dst); } else { } if (hdr_size == 0) { return; } else { } unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data; switch ((int )unicast_4addr_packet->u.packet_type) { case 64: tmp___3 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___3 & 16) != 0) { batadv_debug_log(bat_priv, "* encapsulated within a UNICAST packet\n"); } else { } goto ldv_49961; case 66: tmp___4 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___4 & 16) != 0) { batadv_debug_log(bat_priv, "* encapsulated within a UNICAST_4ADDR packet (src: %pM)\n", (uint8_t *)(& unicast_4addr_packet->src)); } else { } switch ((int )unicast_4addr_packet->subtype) { case 3: tmp___5 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___5 & 16) != 0) { batadv_debug_log(bat_priv, "* type: DAT_DHT_PUT\n"); } else { } goto ldv_49964; case 2: tmp___6 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___6 & 16) != 0) { batadv_debug_log(bat_priv, "* type: DAT_DHT_GET\n"); } else { } goto ldv_49964; case 4: tmp___7 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___7 & 16) != 0) { batadv_debug_log(bat_priv, "* type: DAT_CACHE_REPLY\n"); } else { } goto ldv_49964; case 1: tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___8 & 16) != 0) { batadv_debug_log(bat_priv, "* type: DATA\n"); } else { } goto ldv_49964; default: tmp___9 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___9 & 16) != 0) { batadv_debug_log(bat_priv, "* type: Unknown (%u)!\n", (int )unicast_4addr_packet->u.packet_type); } else { } } ldv_49964: ; goto ldv_49961; case 1: bcast_pkt = (struct batadv_bcast_packet *)unicast_4addr_packet; orig_addr = (uint8_t *)(& bcast_pkt->orig); tmp___10 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___10 & 16) != 0) { batadv_debug_log(bat_priv, "* encapsulated within a BCAST packet (src: %pM)\n", orig_addr); } else { } goto ldv_49961; default: tmp___11 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___11 & 16) != 0) { batadv_debug_log(bat_priv, "* encapsulated within an unknown packet type (0x%x)\n", (int )unicast_4addr_packet->u.packet_type); } else { } } ldv_49961: ; return; } } static bool batadv_is_orig_node_eligible(struct batadv_dat_candidate *res , int select , uint16_t tmp_max , uint16_t max , uint16_t last_max , struct batadv_orig_node *candidate , struct batadv_orig_node *max_orig_node ) { bool ret ; int j ; int tmp ; { ret = 0; if (((int )candidate->capabilities & 1) == 0) { goto out; } else { } j = 0; goto ldv_49985; ldv_49984: ; if ((unsigned long )(res + (unsigned long )j)->orig_node == (unsigned long )candidate) { goto ldv_49983; } else { } j = j + 1; ldv_49985: ; if (j < select) { goto ldv_49984; } else { } ldv_49983: ; if (j < select) { goto out; } else { } if ((int )tmp_max > (int )last_max) { goto out; } else { } if ((int )tmp_max < (int )max) { goto out; } else { } if ((int )tmp_max == (int )max && (unsigned long )max_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { tmp = batadv_compare_eth((void const *)(& candidate->orig), (void const *)(& max_orig_node->orig)); if (tmp > 0) { goto out; } else { } } else { } ret = 1; out: ; return (ret); } } static void batadv_choose_next_candidate(struct batadv_priv *bat_priv , struct batadv_dat_candidate *cands , int select , uint16_t ip_key , uint16_t *last_max ) { uint16_t max ; uint16_t tmp_max ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *max_orig_node ; struct batadv_hashtable *hash ; struct hlist_head *head ; int i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; int tmp___6 ; { max = 0U; tmp_max = 0U; max_orig_node = (struct batadv_orig_node *)0; hash = bat_priv->orig_hash; (cands + (unsigned long )select)->type = 0; i = 0; goto ldv_50025; ldv_50024: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___0 = (struct batadv_orig_node *)0; } orig_node = tmp___0; goto ldv_50022; ldv_50021: tmp_max = ~ ((int )orig_node->dat_addr) + (int )ip_key; tmp___1 = batadv_is_orig_node_eligible(cands, select, (int )tmp_max, (int )max, (int )*last_max, orig_node, max_orig_node); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_50020; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_50020; } else { } max = tmp_max; if ((unsigned long )max_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(max_orig_node); } else { } max_orig_node = orig_node; ldv_50020: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_50022: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_50021; } else { } rcu_read_unlock(); i = i + 1; ldv_50025: ; if ((uint32_t )i < hash->size) { goto ldv_50024; } else { } if ((unsigned long )max_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { (cands + (unsigned long )select)->type = 1; (cands + (unsigned long )select)->orig_node = max_orig_node; tmp___6 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___6 & 16) != 0) { batadv_debug_log(bat_priv, "dat_select_candidates() %d: selected %pM addr=%u dist=%u\n", select, (uint8_t *)(& max_orig_node->orig), (int )max_orig_node->dat_addr, (int )max); } else { } } else { } *last_max = max; return; } } static struct batadv_dat_candidate *batadv_dat_select_candidates(struct batadv_priv *bat_priv , __be32 ip_dst ) { int select ; uint16_t last_max ; uint16_t ip_key ; struct batadv_dat_candidate *res ; void *tmp ; uint32_t tmp___0 ; int tmp___1 ; { last_max = 65535U; if ((unsigned long )bat_priv->orig_hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_dat_candidate *)0); } else { } tmp = kmalloc(48UL, 32U); res = (struct batadv_dat_candidate *)tmp; if ((unsigned long )res == (unsigned long )((struct batadv_dat_candidate *)0)) { return ((struct batadv_dat_candidate *)0); } else { } tmp___0 = batadv_hash_dat((void const *)(& ip_dst), 65535U); ip_key = (unsigned short )tmp___0; tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 16) != 0) { batadv_debug_log(bat_priv, "dat_select_candidates(): IP=%pI4 hash(IP)=%u\n", & ip_dst, (int )ip_key); } else { } select = 0; goto ldv_50036; ldv_50035: batadv_choose_next_candidate(bat_priv, res, select, (int )ip_key, & last_max); select = select + 1; ldv_50036: ; if (select <= 2) { goto ldv_50035; } else { } return (res); } } static bool batadv_dat_send_data(struct batadv_priv *bat_priv , struct sk_buff *skb , __be32 ip , int packet_subtype ) { int i ; bool ret ; int send_status ; struct batadv_neigh_node *neigh_node ; struct sk_buff *tmp_skb ; struct batadv_dat_candidate *cand ; int tmp ; bool tmp___0 ; int tmp___1 ; { ret = 0; neigh_node = (struct batadv_neigh_node *)0; cand = batadv_dat_select_candidates(bat_priv, ip); if ((unsigned long )cand == (unsigned long )((struct batadv_dat_candidate *)0)) { goto out; } else { } tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 16) != 0) { batadv_debug_log(bat_priv, "DHT_SEND for %pI4\n", & ip); } else { } i = 0; goto ldv_50058; ldv_50057: ; if ((cand + (unsigned long )i)->type == 0) { goto ldv_50051; } else { } neigh_node = batadv_orig_router_get((cand + (unsigned long )i)->orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto free_orig; } else { } tmp_skb = pskb_copy_for_clone(skb, 32U); tmp___0 = batadv_send_skb_prepare_unicast_4addr(bat_priv, tmp_skb, (cand + (unsigned long )i)->orig_node, packet_subtype); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { kfree_skb(tmp_skb); goto free_neigh; } else { } send_status = batadv_send_skb_packet(tmp_skb, neigh_node->if_incoming, (uint8_t const *)(& neigh_node->addr)); if (send_status == 0) { switch (packet_subtype) { case 2: batadv_add_counter___1(bat_priv, 23UL, 1UL); goto ldv_50055; case 3: batadv_add_counter___1(bat_priv, 25UL, 1UL); goto ldv_50055; } ldv_50055: ret = 1; } else { } free_neigh: batadv_neigh_node_free_ref(neigh_node); free_orig: batadv_orig_node_free_ref((cand + (unsigned long )i)->orig_node); ldv_50051: i = i + 1; ldv_50058: ; if (i <= 2) { goto ldv_50057; } else { } out: kfree((void const *)cand); return (ret); } } static void batadv_dat_tvlv_container_update(struct batadv_priv *bat_priv ) { char dat_mode ; int tmp ; { tmp = atomic_read((atomic_t const *)(& bat_priv->distributed_arp_table)); dat_mode = (char )tmp; switch ((int )dat_mode) { case 0: batadv_tvlv_container_unregister(bat_priv, 2, 1); goto ldv_50065; case 1: batadv_tvlv_container_register(bat_priv, 2, 1, (void *)0, 0); goto ldv_50065; } ldv_50065: ; return; } } void batadv_dat_status_update(struct net_device *net_dev ) { struct batadv_priv *bat_priv ; void *tmp ; { tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; batadv_dat_tvlv_container_update(bat_priv); return; } } static void batadv_dat_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t flags , void *tvlv_value , uint16_t tvlv_value_len ) { { if (((int )flags & 2) != 0) { orig->capabilities = (unsigned int )orig->capabilities & 254U; } else { orig->capabilities = (uint8_t )((unsigned int )orig->capabilities | 1U); } return; } } static void batadv_dat_hash_free(struct batadv_priv *bat_priv ) { { if ((unsigned long )bat_priv->dat.hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } __batadv_dat_purge(bat_priv, (bool (*)(struct batadv_dat_entry * ))0); batadv_hash_destroy(bat_priv->dat.hash); bat_priv->dat.hash = (struct batadv_hashtable *)0; return; } } int batadv_dat_init(struct batadv_priv *bat_priv ) { { if ((unsigned long )bat_priv->dat.hash != (unsigned long )((struct batadv_hashtable *)0)) { return (0); } else { } bat_priv->dat.hash = batadv_hash_new(1024U); if ((unsigned long )bat_priv->dat.hash == (unsigned long )((struct batadv_hashtable *)0)) { return (-12); } else { } batadv_dat_start_timer(bat_priv); batadv_tvlv_handler_register(bat_priv, & batadv_dat_tvlv_ogm_handler_v1, (int (*)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ))0, 2, 1, 2); batadv_dat_tvlv_container_update(bat_priv); return (0); } } void batadv_dat_free(struct batadv_priv *bat_priv ) { { batadv_tvlv_container_unregister(bat_priv, 2, 1); batadv_tvlv_handler_unregister(bat_priv, 2, 1); cancel_delayed_work_sync(& bat_priv->dat.work); batadv_dat_hash_free(bat_priv); return; } } int batadv_dat_cache_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct batadv_dat_entry *dat_entry ; struct batadv_hard_iface *primary_if ; struct hlist_head *head ; unsigned long last_seen_jiffies ; int last_seen_msecs ; int last_seen_secs ; int last_seen_mins ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_dat_entry *tmp___1 ; unsigned int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_dat_entry *tmp___4 ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->dat.hash; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } seq_printf(seq, "Distributed ARP Table (%s):\n", (char *)(& net_dev->name)); seq_printf(seq, " %-7s %-9s %4s %11s\n", (char *)"IPv4", (char *)"MAC", (char *)"VID", (char *)"last-seen"); i = 0U; goto ldv_50127; ldv_50126: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_dat_entry *)__mptr + 0xffffffffffffffe8UL; } else { tmp___1 = (struct batadv_dat_entry *)0; } dat_entry = tmp___1; goto ldv_50124; ldv_50123: last_seen_jiffies = (unsigned long )jiffies - dat_entry->last_update; tmp___2 = jiffies_to_msecs(last_seen_jiffies); last_seen_msecs = (int )tmp___2; last_seen_mins = last_seen_msecs / 60000; last_seen_msecs = last_seen_msecs % 60000; last_seen_secs = last_seen_msecs / 1000; seq_printf(seq, " * %15pI4 %14pM %4i %6i:%02i\n", & dat_entry->ip, (uint8_t *)(& dat_entry->mac_addr), (int )((short )dat_entry->vid) < 0 ? (int )dat_entry->vid & 4095 : -1, last_seen_mins, last_seen_secs); _________p1___0 = *((struct hlist_node * volatile *)(& dat_entry->hash_entry.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_dat_entry *)__mptr___0 + 0xffffffffffffffe8UL; } else { tmp___4 = (struct batadv_dat_entry *)0; } dat_entry = tmp___4; ldv_50124: ; if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { goto ldv_50123; } else { } rcu_read_unlock(); i = i + 1U; ldv_50127: ; if (hash->size > i) { goto ldv_50126; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } static uint16_t batadv_arp_get_type(struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_size ) { struct arphdr *arphdr ; struct ethhdr *ethhdr ; __be32 ip_src ; __be32 ip_dst ; uint8_t *hw_src ; uint8_t *hw_dst ; uint16_t type ; int tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; long tmp___3 ; bool tmp___4 ; bool tmp___5 ; bool tmp___6 ; bool tmp___7 ; bool tmp___8 ; bool tmp___9 ; bool tmp___10 ; bool tmp___11 ; bool tmp___12 ; bool tmp___13 ; bool tmp___14 ; bool tmp___15 ; __u16 tmp___16 ; { type = 0U; tmp = pskb_may_pull(skb, (unsigned int )(hdr_size + 14)); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { goto out; } else { } ethhdr = (struct ethhdr *)skb->data + (unsigned long )hdr_size; if ((unsigned int )ethhdr->h_proto != 1544U) { goto out; } else { } tmp___1 = arp_hdr_len(skb->dev); tmp___2 = pskb_may_pull(skb, (unsigned int )((hdr_size + 14) + tmp___1)); tmp___3 = ldv__builtin_expect(tmp___2 == 0, 0L); if (tmp___3 != 0L) { goto out; } else { } arphdr = (struct arphdr *)(skb->data + ((unsigned long )hdr_size + 14UL)); if ((unsigned int )arphdr->ar_hrd != 256U) { goto out; } else { } if ((unsigned int )arphdr->ar_pro != 8U) { goto out; } else { } if ((unsigned int )arphdr->ar_hln != 6U) { goto out; } else { } if ((unsigned int )arphdr->ar_pln != 4U) { goto out; } else { } ip_src = batadv_arp_ip_src(skb, hdr_size); ip_dst = batadv_arp_ip_dst(skb, hdr_size); tmp___4 = ipv4_is_loopback(ip_src); if ((int )tmp___4) { goto out; } else { tmp___5 = ipv4_is_multicast(ip_src); if ((int )tmp___5) { goto out; } else { tmp___6 = ipv4_is_loopback(ip_dst); if ((int )tmp___6) { goto out; } else { tmp___7 = ipv4_is_multicast(ip_dst); if ((int )tmp___7) { goto out; } else { tmp___8 = ipv4_is_zeronet(ip_src); if ((int )tmp___8) { goto out; } else { tmp___9 = ipv4_is_lbcast(ip_src); if ((int )tmp___9) { goto out; } else { tmp___10 = ipv4_is_zeronet(ip_dst); if ((int )tmp___10) { goto out; } else { tmp___11 = ipv4_is_lbcast(ip_dst); if ((int )tmp___11) { goto out; } else { } } } } } } } } hw_src = batadv_arp_hw_src(skb, hdr_size); tmp___12 = is_zero_ether_addr((u8 const *)hw_src); if ((int )tmp___12) { goto out; } else { tmp___13 = is_multicast_ether_addr((u8 const *)hw_src); if ((int )tmp___13) { goto out; } else { } } if ((unsigned int )arphdr->ar_op != 256U) { hw_dst = batadv_arp_hw_dst(skb, hdr_size); tmp___14 = is_zero_ether_addr((u8 const *)hw_dst); if ((int )tmp___14) { goto out; } else { tmp___15 = is_multicast_ether_addr((u8 const *)hw_dst); if ((int )tmp___15) { goto out; } else { } } } else { } tmp___16 = __fswab16((int )arphdr->ar_op); type = tmp___16; out: ; return (type); } } static unsigned short batadv_dat_get_vid(struct sk_buff *skb , int *hdr_size ) { unsigned short vid ; { vid = batadv_get_vid(skb, (size_t )*hdr_size); if ((int )((short )vid) < 0) { *hdr_size = *hdr_size + 4; } else { } return (vid); } } bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv , struct sk_buff *skb ) { uint16_t type ; __be32 ip_dst ; __be32 ip_src ; uint8_t *hw_src ; bool ret ; struct batadv_dat_entry *dat_entry ; struct sk_buff *skb_new ; int hdr_size ; unsigned short vid ; int tmp ; bool tmp___0 ; int tmp___1 ; { type = 0U; ret = 0; dat_entry = (struct batadv_dat_entry *)0; hdr_size = 0; tmp = atomic_read((atomic_t const *)(& bat_priv->distributed_arp_table)); if (tmp == 0) { goto out; } else { } vid = batadv_dat_get_vid(skb, & hdr_size); type = batadv_arp_get_type(bat_priv, skb, hdr_size); if ((unsigned int )type != 1U) { goto out; } else { } batadv_dbg_arp(bat_priv, skb, (int )type, hdr_size, (char *)"Parsing outgoing ARP REQUEST"); ip_src = batadv_arp_ip_src(skb, hdr_size); hw_src = batadv_arp_hw_src(skb, hdr_size); ip_dst = batadv_arp_ip_dst(skb, hdr_size); batadv_dat_entry_add(bat_priv, ip_src, hw_src, (int )vid); dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst, (int )vid); if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { tmp___0 = batadv_is_my_client(bat_priv, (uint8_t const *)(& dat_entry->mac_addr), (int )vid); if ((int )tmp___0) { ret = 1; goto out; } else { } skb_new = arp_create(2, 2054, ip_src, bat_priv->soft_iface, ip_dst, (unsigned char const *)hw_src, (unsigned char const *)(& dat_entry->mac_addr), (unsigned char const *)hw_src); if ((unsigned long )skb_new == (unsigned long )((struct sk_buff *)0)) { goto out; } else { } if ((int )((short )vid) < 0) { skb_new = vlan_insert_tag___0(skb_new, 129, (int )vid & 4095); } else { } skb_reset_mac_header(skb_new); skb_new->protocol = eth_type_trans(skb_new, bat_priv->soft_iface); bat_priv->stats.rx_packets = bat_priv->stats.rx_packets + 1UL; bat_priv->stats.rx_bytes = bat_priv->stats.rx_bytes + (unsigned long )((skb->len + (unsigned int )hdr_size) + 14U); (bat_priv->soft_iface)->last_rx = jiffies; netif_rx(skb_new); tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 16) != 0) { batadv_debug_log(bat_priv, "ARP request replied locally\n"); } else { } ret = 1; } else { ret = batadv_dat_send_data(bat_priv, skb, ip_dst, 2); } out: ; if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { batadv_dat_entry_free_ref(dat_entry); } else { } return (ret); } } bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_size ) { uint16_t type ; __be32 ip_src ; __be32 ip_dst ; uint8_t *hw_src ; struct sk_buff *skb_new ; struct batadv_dat_entry *dat_entry ; bool ret ; unsigned short vid ; int err ; int tmp ; { dat_entry = (struct batadv_dat_entry *)0; ret = 0; tmp = atomic_read((atomic_t const *)(& bat_priv->distributed_arp_table)); if (tmp == 0) { goto out; } else { } vid = batadv_dat_get_vid(skb, & hdr_size); type = batadv_arp_get_type(bat_priv, skb, hdr_size); if ((unsigned int )type != 1U) { goto out; } else { } hw_src = batadv_arp_hw_src(skb, hdr_size); ip_src = batadv_arp_ip_src(skb, hdr_size); ip_dst = batadv_arp_ip_dst(skb, hdr_size); batadv_dbg_arp(bat_priv, skb, (int )type, hdr_size, (char *)"Parsing incoming ARP REQUEST"); batadv_dat_entry_add(bat_priv, ip_src, hw_src, (int )vid); dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst, (int )vid); if ((unsigned long )dat_entry == (unsigned long )((struct batadv_dat_entry *)0)) { goto out; } else { } skb_new = arp_create(2, 2054, ip_src, bat_priv->soft_iface, ip_dst, (unsigned char const *)hw_src, (unsigned char const *)(& dat_entry->mac_addr), (unsigned char const *)hw_src); if ((unsigned long )skb_new == (unsigned long )((struct sk_buff *)0)) { goto out; } else { } skb_reset_mac_header(skb_new); if ((int )((short )vid) < 0) { skb_new = vlan_insert_tag___0(skb_new, 129, (int )vid & 4095); } else { } if (hdr_size == 18) { err = batadv_send_skb_via_tt_4addr(bat_priv, skb_new, 4, (uint8_t *)0U, (int )vid); } else { err = batadv_send_skb_via_tt(bat_priv, skb_new, (uint8_t *)0U, (int )vid); } if (err != 1) { batadv_add_counter___1(bat_priv, 27UL, 1UL); ret = 1; } else { } out: ; if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { batadv_dat_entry_free_ref(dat_entry); } else { } if ((int )ret) { kfree_skb(skb); } else { } return (ret); } } void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv , struct sk_buff *skb ) { uint16_t type ; __be32 ip_src ; __be32 ip_dst ; uint8_t *hw_src ; uint8_t *hw_dst ; int hdr_size ; unsigned short vid ; int tmp ; { hdr_size = 0; tmp = atomic_read((atomic_t const *)(& bat_priv->distributed_arp_table)); if (tmp == 0) { return; } else { } vid = batadv_dat_get_vid(skb, & hdr_size); type = batadv_arp_get_type(bat_priv, skb, hdr_size); if ((unsigned int )type != 2U) { return; } else { } batadv_dbg_arp(bat_priv, skb, (int )type, hdr_size, (char *)"Parsing outgoing ARP REPLY"); hw_src = batadv_arp_hw_src(skb, hdr_size); ip_src = batadv_arp_ip_src(skb, hdr_size); hw_dst = batadv_arp_hw_dst(skb, hdr_size); ip_dst = batadv_arp_ip_dst(skb, hdr_size); batadv_dat_entry_add(bat_priv, ip_src, hw_src, (int )vid); batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, (int )vid); batadv_dat_send_data(bat_priv, skb, ip_src, 3); batadv_dat_send_data(bat_priv, skb, ip_dst, 3); return; } } bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_size ) { uint16_t type ; __be32 ip_src ; __be32 ip_dst ; uint8_t *hw_src ; uint8_t *hw_dst ; bool ret ; unsigned short vid ; int tmp ; bool tmp___0 ; int tmp___1 ; { ret = 0; tmp = atomic_read((atomic_t const *)(& bat_priv->distributed_arp_table)); if (tmp == 0) { goto out; } else { } vid = batadv_dat_get_vid(skb, & hdr_size); type = batadv_arp_get_type(bat_priv, skb, hdr_size); if ((unsigned int )type != 2U) { goto out; } else { } batadv_dbg_arp(bat_priv, skb, (int )type, hdr_size, (char *)"Parsing incoming ARP REPLY"); hw_src = batadv_arp_hw_src(skb, hdr_size); ip_src = batadv_arp_ip_src(skb, hdr_size); hw_dst = batadv_arp_hw_dst(skb, hdr_size); ip_dst = batadv_arp_ip_dst(skb, hdr_size); batadv_dat_entry_add(bat_priv, ip_src, hw_src, (int )vid); batadv_dat_entry_add(bat_priv, ip_dst, hw_dst, (int )vid); tmp___0 = batadv_is_my_client(bat_priv, (uint8_t const *)hw_dst, (int )vid); if ((int )tmp___0 != 0) { tmp___1 = 0; } else { tmp___1 = 1; } ret = (bool )tmp___1; out: ; if ((int )ret) { kfree_skb(skb); } else { } return (ret); } } bool batadv_dat_drop_broadcast_packet(struct batadv_priv *bat_priv , struct batadv_forw_packet *forw_packet ) { uint16_t type ; __be32 ip_dst ; struct batadv_dat_entry *dat_entry ; bool ret ; int hdr_size ; unsigned short vid ; int tmp ; int tmp___0 ; int tmp___1 ; { dat_entry = (struct batadv_dat_entry *)0; ret = 0; hdr_size = 14; tmp = atomic_read((atomic_t const *)(& bat_priv->distributed_arp_table)); if (tmp == 0) { goto out; } else { } if ((unsigned int )forw_packet->num_packets != 0U) { goto out; } else { } vid = batadv_dat_get_vid(forw_packet->skb, & hdr_size); type = batadv_arp_get_type(bat_priv, forw_packet->skb, hdr_size); if ((unsigned int )type != 1U) { goto out; } else { } ip_dst = batadv_arp_ip_dst(forw_packet->skb, hdr_size); dat_entry = batadv_dat_entry_hash_find(bat_priv, ip_dst, (int )vid); if ((unsigned long )dat_entry == (unsigned long )((struct batadv_dat_entry *)0)) { tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 16) != 0) { batadv_debug_log(bat_priv, "ARP Request for %pI4: fallback\n", & ip_dst); } else { } goto out; } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 16) != 0) { batadv_debug_log(bat_priv, "ARP Request for %pI4: fallback prevented\n", & ip_dst); } else { } ret = 1; out: ; if ((unsigned long )dat_entry != (unsigned long )((struct batadv_dat_entry *)0)) { batadv_dat_entry_free_ref(dat_entry); } else { } return (ret); } } void *ldv_kmem_cache_alloc_196(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_202(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_204(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_206(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_207(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_208(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_209(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_210(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_211(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_212(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_213(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void hlist_del(struct hlist_node *n ) { { __hlist_del(n); n->next = (struct hlist_node *)-2401263026317557504L; n->pprev = (struct hlist_node **)-2401263026316508672L; return; } } __inline static void hlist_add_before(struct hlist_node *n , struct hlist_node *next ) { { n->pprev = next->pprev; n->next = next; next->pprev = & n->next; *(n->pprev) = n; return; } } __inline static void hlist_add_after(struct hlist_node *n , struct hlist_node *next ) { { next->next = n->next; n->next = next; next->pprev = & n->next; if ((unsigned long )next->next != (unsigned long )((struct hlist_node *)0)) { (next->next)->pprev = & next->next; } else { } return; } } __inline static void hlist_move_list(struct hlist_head *old , struct hlist_head *new ) { { new->first = old->first; if ((unsigned long )new->first != (unsigned long )((struct hlist_node *)0)) { (new->first)->pprev = & new->first; } else { } old->first = (struct hlist_node *)0; return; } } extern void __xadd_wrong_size(void) ; __inline static int atomic_add_return(int i , atomic_t *v ) { int __ret ; { __ret = i; switch (4UL) { case 1UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddb %b0, %1\n": "+q" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5626; case 2UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddw %w0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5626; case 4UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddl %0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5626; case 8UL: __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; xaddq %q0, %1\n": "+r" (__ret), "+m" (v->counter): : "memory", "cc"); goto ldv_5626; default: __xadd_wrong_size(); } ldv_5626: ; return (__ret + i); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_240(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_257(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_248(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_256(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_250(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_246(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_254(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_255(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_258(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_259(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; __inline static bool skb_is_nonlinear(struct sk_buff const *skb ) { { return ((unsigned int )skb->data_len != 0U); } } __inline static void skb_reset_transport_header(struct sk_buff *skb ) { { skb->transport_header = (int )((__u16 )((long )skb->data)) - (int )((__u16 )((long )skb->head)); return; } } __inline static void skb_reset_network_header(struct sk_buff *skb ) { { skb->network_header = (int )((__u16 )((long )skb->data)) - (int )((__u16 )((long )skb->head)); return; } } __inline static void skb_set_mac_header(struct sk_buff *skb , int const offset ) { { skb_reset_mac_header(skb); skb->mac_header = (int )skb->mac_header + (int )((__u16 )offset); return; } } struct sk_buff *ldv___netdev_alloc_skb_251(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_252(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_253(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *netdev_alloc_skb(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = ldv___netdev_alloc_skb_251(dev, length, 32U); return (tmp); } } __inline static int __skb_linearize(struct sk_buff *skb ) { unsigned char *tmp ; { tmp = __pskb_pull_tail(skb, (int )skb->data_len); return ((unsigned long )tmp != (unsigned long )((unsigned char *)0U) ? 0 : -12); } } __inline static int skb_linearize(struct sk_buff *skb ) { int tmp___0 ; int tmp___1 ; bool tmp___2 ; { tmp___2 = skb_is_nonlinear((struct sk_buff const *)skb); if ((int )tmp___2) { tmp___0 = __skb_linearize(skb); tmp___1 = tmp___0; } else { tmp___1 = 0; } return (tmp___1); } } extern unsigned char *skb_pull_rcsum(struct sk_buff * , unsigned int ) ; extern void skb_split(struct sk_buff * , struct sk_buff * , u32 const ) ; __inline static void batadv_add_counter___2(struct batadv_priv *bat_priv , size_t idx , size_t count ) { void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; { __vpp_verify = (void const *)0; switch (8UL) { case 1UL: pao_ID__ = 0; switch (8UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49267; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49267; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49267; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49267; default: __bad_percpu_size(); } ldv_49267: ; goto ldv_49272; case 2UL: pao_ID_____0 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49278; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49278; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49278; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49278; default: __bad_percpu_size(); } ldv_49278: ; goto ldv_49272; case 4UL: pao_ID_____1 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49288; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49288; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49288; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49288; default: __bad_percpu_size(); } ldv_49288: ; goto ldv_49272; case 8UL: pao_ID_____2 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49298; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49298; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49298; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49298; default: __bad_percpu_size(); } ldv_49298: ; goto ldv_49272; default: __bad_size_call_parameter(); goto ldv_49272; } ldv_49272: ; return; } } void batadv_frag_purge_orig(struct batadv_orig_node *orig_node , bool (*check_cb)(struct batadv_frag_table_entry * ) ) ; bool batadv_frag_skb_fwd(struct sk_buff *skb , struct batadv_hard_iface *recv_if , struct batadv_orig_node *orig_node_src ) ; bool batadv_frag_skb_buffer(struct sk_buff **skb , struct batadv_orig_node *orig_node_src ) ; bool batadv_frag_send_packet(struct sk_buff *skb , struct batadv_orig_node *orig_node , struct batadv_neigh_node *neigh_node ) ; __inline static uint32_t batadv_choose_orig___1(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49604; ldv_49603: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49604: ; if (i <= 5UL) { goto ldv_49603; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find___1(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig___1(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_49638; ldv_49637: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_49635; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49635; } else { } orig_node_tmp = orig_node; goto ldv_49636; ldv_49635: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_49638: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49637; } else { } ldv_49636: rcu_read_unlock(); return (orig_node_tmp); } } struct batadv_neigh_node *batadv_find_router(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_hard_iface *recv_if ) ; int batadv_skb_head_push(struct sk_buff *skb , unsigned int len ) ; static void batadv_frag_clear_chain(struct hlist_head *head ) { struct batadv_frag_list_entry *entry ; struct hlist_node *node ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_frag_list_entry *tmp ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_frag_list_entry *tmp___0 ; { ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_frag_list_entry *)__mptr; } else { tmp = (struct batadv_frag_list_entry *)0; } entry = tmp; goto ldv_49764; ldv_49763: hlist_del(& entry->list); kfree_skb(entry->skb); kfree((void const *)entry); ____ptr___0 = node; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_frag_list_entry *)__mptr___0; } else { tmp___0 = (struct batadv_frag_list_entry *)0; } entry = tmp___0; ldv_49764: ; if ((unsigned long )entry != (unsigned long )((struct batadv_frag_list_entry *)0)) { node = entry->list.next; goto ldv_49763; } else { } return; } } void batadv_frag_purge_orig(struct batadv_orig_node *orig_node , bool (*check_cb)(struct batadv_frag_table_entry * ) ) { struct batadv_frag_table_entry *chain ; uint8_t i ; bool tmp ; { i = 0U; goto ldv_49774; ldv_49773: chain = (struct batadv_frag_table_entry *)(& orig_node->fragments) + (unsigned long )i; spin_lock_bh(& orig_node->fragments[(int )i].lock); if ((unsigned long )check_cb == (unsigned long )((bool (*)(struct batadv_frag_table_entry * ))0)) { batadv_frag_clear_chain(& orig_node->fragments[(int )i].head); orig_node->fragments[(int )i].size = 0U; } else { tmp = (*check_cb)(chain); if ((int )tmp) { batadv_frag_clear_chain(& orig_node->fragments[(int )i].head); orig_node->fragments[(int )i].size = 0U; } else { } } spin_unlock_bh(& orig_node->fragments[(int )i].lock); i = (uint8_t )((int )i + 1); ldv_49774: ; if ((unsigned int )i <= 7U) { goto ldv_49773; } else { } return; } } static int batadv_frag_size_limit(void) { int limit ; { limit = 1400; limit = (int )((unsigned int )limit - 20U); limit = limit * 16; return (limit); } } static bool batadv_frag_init_chain(struct batadv_frag_table_entry *chain , uint16_t seqno ) { int tmp ; { if ((int )chain->seqno == (int )seqno) { return (0); } else { } tmp = hlist_empty((struct hlist_head const *)(& chain->head)); if (tmp == 0) { batadv_frag_clear_chain(& chain->head); } else { } chain->size = 0U; chain->seqno = seqno; return (1); } } static bool batadv_frag_insert_packet(struct batadv_orig_node *orig_node , struct sk_buff *skb , struct hlist_head *chain_out ) { struct batadv_frag_table_entry *chain ; struct batadv_frag_list_entry *frag_entry_new ; struct batadv_frag_list_entry *frag_entry_curr ; struct batadv_frag_packet *frag_packet ; uint8_t bucket ; uint16_t seqno ; uint16_t hdr_size ; bool ret ; int tmp ; __u16 tmp___0 ; void *tmp___1 ; bool tmp___2 ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_frag_list_entry *tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_frag_list_entry *tmp___4 ; long tmp___5 ; __u16 tmp___6 ; int tmp___7 ; __u16 tmp___8 ; int tmp___9 ; { frag_entry_new = (struct batadv_frag_list_entry *)0; hdr_size = 20U; ret = 0; tmp = skb_linearize(skb); if (tmp < 0) { goto err; } else { } frag_packet = (struct batadv_frag_packet *)skb->data; tmp___0 = __fswab16((int )frag_packet->seqno); seqno = tmp___0; bucket = (unsigned int )((uint8_t )seqno) & 7U; tmp___1 = kmalloc(32UL, 32U); frag_entry_new = (struct batadv_frag_list_entry *)tmp___1; if ((unsigned long )frag_entry_new == (unsigned long )((struct batadv_frag_list_entry *)0)) { goto err; } else { } frag_entry_new->skb = skb; frag_entry_new->no = frag_packet->no; chain = (struct batadv_frag_table_entry *)(& orig_node->fragments) + (unsigned long )bucket; spin_lock_bh(& chain->lock); tmp___2 = batadv_frag_init_chain(chain, (int )seqno); if ((int )tmp___2) { hlist_add_head(& frag_entry_new->list, & chain->head); chain->size = (int )((uint16_t )skb->len) - (int )hdr_size; chain->timestamp = jiffies; ret = 1; goto out; } else { } ____ptr = chain->head.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___3 = (struct batadv_frag_list_entry *)__mptr; } else { tmp___3 = (struct batadv_frag_list_entry *)0; } frag_entry_curr = tmp___3; goto ldv_49809; ldv_49808: ; if ((int )frag_entry_curr->no == (int )frag_entry_new->no) { goto err_unlock; } else { } if ((int )frag_entry_curr->no < (int )frag_entry_new->no) { hlist_add_before(& frag_entry_new->list, & frag_entry_curr->list); chain->size = (int )chain->size + ((int )((uint16_t )skb->len) - (int )hdr_size); chain->timestamp = jiffies; ret = 1; goto out; } else { } ____ptr___0 = frag_entry_curr->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_frag_list_entry *)__mptr___0; } else { tmp___4 = (struct batadv_frag_list_entry *)0; } frag_entry_curr = tmp___4; ldv_49809: ; if ((unsigned long )frag_entry_curr != (unsigned long )((struct batadv_frag_list_entry *)0)) { goto ldv_49808; } else { } tmp___5 = ldv__builtin_expect((unsigned long )frag_entry_curr != (unsigned long )((struct batadv_frag_list_entry *)0), 1L); if (tmp___5 != 0L) { hlist_add_after(& frag_entry_curr->list, & frag_entry_new->list); chain->size = (int )chain->size + ((int )((uint16_t )skb->len) - (int )hdr_size); chain->timestamp = jiffies; ret = 1; } else { } out: tmp___7 = batadv_frag_size_limit(); if ((int )chain->size > tmp___7) { batadv_frag_clear_chain(& chain->head); chain->size = 0U; } else { tmp___8 = __fswab16((int )frag_packet->total_size); tmp___9 = batadv_frag_size_limit(); if ((int )tmp___8 > tmp___9) { batadv_frag_clear_chain(& chain->head); chain->size = 0U; } else { tmp___6 = __fswab16((int )frag_packet->total_size); if ((int )tmp___6 == (int )chain->size) { hlist_move_list(& chain->head, chain_out); chain->size = 0U; } else { } } } err_unlock: spin_unlock_bh(& chain->lock); err: ; if (! ret) { kfree((void const *)frag_entry_new); } else { } return (ret); } } static struct sk_buff *batadv_frag_merge_packets(struct hlist_head *chain , struct sk_buff *skb ) { struct batadv_frag_packet *packet ; struct batadv_frag_list_entry *entry ; struct sk_buff *skb_out ; int size ; int hdr_size ; __u16 tmp ; int tmp___0 ; struct hlist_node const *__mptr ; int tmp___1 ; unsigned char *tmp___2 ; struct hlist_node *____ptr ; struct hlist_node const *__mptr___0 ; struct batadv_frag_list_entry *tmp___3 ; size_t __len ; void *__ret ; unsigned char *tmp___5 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_frag_list_entry *tmp___6 ; { skb_out = (struct sk_buff *)0; hdr_size = 20; packet = (struct batadv_frag_packet *)skb->data; tmp = __fswab16((int )packet->total_size); size = (int )tmp; tmp___0 = batadv_frag_size_limit(); if (tmp___0 < size) { goto free; } else { } __mptr = (struct hlist_node const *)chain->first; entry = (struct batadv_frag_list_entry *)__mptr; hlist_del(& entry->list); skb_out = entry->skb; kfree((void const *)entry); tmp___1 = ldv_pskb_expand_head_258(skb_out, 0, (int )((unsigned int )size - skb->len), 32U); if (tmp___1 < 0) { kfree_skb(skb_out); skb_out = (struct sk_buff *)0; goto free; } else { } skb_pull_rcsum(skb_out, (unsigned int )hdr_size); tmp___2 = skb_mac_header((struct sk_buff const *)skb_out); memmove((void *)skb_out->data + 0xfffffffffffffff2UL, (void const *)tmp___2, 14UL); skb_set_mac_header(skb_out, -14); skb_reset_network_header(skb_out); skb_reset_transport_header(skb_out); ____ptr = chain->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr; tmp___3 = (struct batadv_frag_list_entry *)__mptr___0; } else { tmp___3 = (struct batadv_frag_list_entry *)0; } entry = tmp___3; goto ldv_49835; ldv_49834: size = (int )((entry->skb)->len - (unsigned int )hdr_size); __len = (size_t )size; tmp___5 = skb_put(skb_out, (unsigned int )size); __ret = __builtin_memcpy((void *)tmp___5, (void const *)(entry->skb)->data + (unsigned long )hdr_size, __len); ____ptr___0 = entry->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___6 = (struct batadv_frag_list_entry *)__mptr___1; } else { tmp___6 = (struct batadv_frag_list_entry *)0; } entry = tmp___6; ldv_49835: ; if ((unsigned long )entry != (unsigned long )((struct batadv_frag_list_entry *)0)) { goto ldv_49834; } else { } free: batadv_frag_clear_chain(chain); return (skb_out); } } bool batadv_frag_skb_buffer(struct sk_buff **skb , struct batadv_orig_node *orig_node_src ) { struct sk_buff *skb_out ; struct hlist_head head ; bool ret ; bool tmp ; int tmp___0 ; int tmp___1 ; { skb_out = (struct sk_buff *)0; head.first = (struct hlist_node *)0; ret = 0; tmp = batadv_frag_insert_packet(orig_node_src, *skb, & head); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto out_err; } else { } tmp___1 = hlist_empty((struct hlist_head const *)(& head)); if (tmp___1 != 0) { goto out; } else { } skb_out = batadv_frag_merge_packets(& head, *skb); if ((unsigned long )skb_out == (unsigned long )((struct sk_buff *)0)) { goto out_err; } else { } out: *skb = skb_out; ret = 1; out_err: ; return (ret); } } bool batadv_frag_skb_fwd(struct sk_buff *skb , struct batadv_hard_iface *recv_if , struct batadv_orig_node *orig_node_src ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_orig_node *orig_node_dst ; struct batadv_neigh_node *neigh_node ; struct batadv_frag_packet *packet ; uint16_t total_size ; bool ret ; __u16 tmp___0 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; orig_node_dst = (struct batadv_orig_node *)0; neigh_node = (struct batadv_neigh_node *)0; ret = 0; packet = (struct batadv_frag_packet *)skb->data; orig_node_dst = batadv_orig_hash_find___1(bat_priv, (void const *)(& packet->dest)); if ((unsigned long )orig_node_dst == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } neigh_node = batadv_find_router(bat_priv, orig_node_dst, recv_if); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } tmp___0 = __fswab16((int )packet->total_size); total_size = tmp___0; if ((unsigned int )total_size > ((neigh_node->if_incoming)->net_dev)->mtu) { batadv_add_counter___2(bat_priv, 15UL, 1UL); batadv_add_counter___2(bat_priv, 16UL, (size_t )(skb->len + 14U)); packet->ttl = (uint8_t )((int )packet->ttl - 1); batadv_send_skb_packet(skb, neigh_node->if_incoming, (uint8_t const *)(& neigh_node->addr)); ret = 1; } else { } out: ; if ((unsigned long )orig_node_dst != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node_dst); } else { } if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(neigh_node); } else { } return (ret); } } static struct sk_buff *batadv_frag_create(struct sk_buff *skb , struct batadv_frag_packet *frag_head , unsigned int mtu ) { struct sk_buff *skb_fragment ; unsigned int header_size ; unsigned int fragment_size ; size_t __len ; void *__ret ; { header_size = 20U; fragment_size = mtu - header_size; skb_fragment = netdev_alloc_skb((struct net_device *)0, mtu + 14U); if ((unsigned long )skb_fragment == (unsigned long )((struct sk_buff *)0)) { goto err; } else { } skb->priority = 7U; skb_reserve(skb_fragment, (int )(header_size + 14U)); skb_split(skb, skb_fragment, skb->len - fragment_size); skb_push(skb_fragment, header_size); __len = (size_t )header_size; __ret = __builtin_memcpy((void *)skb_fragment->data, (void const *)frag_head, __len); err: ; return (skb_fragment); } } bool batadv_frag_send_packet(struct sk_buff *skb , struct batadv_orig_node *orig_node , struct batadv_neigh_node *neigh_node ) { struct batadv_priv *bat_priv ; struct batadv_hard_iface *primary_if ; struct batadv_frag_packet frag_header ; struct sk_buff *skb_fragment ; unsigned int mtu ; unsigned int header_size ; unsigned int max_fragment_size ; unsigned int max_packet_size ; bool ret ; unsigned int __min1 ; unsigned int __min2 ; int tmp ; __u16 tmp___0 ; __u16 tmp___1 ; int tmp___2 ; int tmp___3 ; size_t __len ; void *__ret ; { primary_if = (struct batadv_hard_iface *)0; mtu = ((neigh_node->if_incoming)->net_dev)->mtu; header_size = 20U; ret = 0; __min1 = mtu; __min2 = 1400U; mtu = __min1 < __min2 ? __min1 : __min2; max_fragment_size = (mtu - header_size) - 14U; max_packet_size = max_fragment_size * 16U; if (skb->len > max_packet_size) { goto out_err; } else { } bat_priv = orig_node->bat_priv; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out_err; } else { } frag_header.packet_type = 65U; frag_header.version = 15U; frag_header.ttl = 50U; tmp = atomic_add_return(1, & bat_priv->frag_seqno); tmp___0 = __fswab16((int )((__u16 )tmp)); frag_header.seqno = tmp___0; frag_header.reserved = 0U; frag_header.no = 0U; tmp___1 = __fswab16((int )((__u16 )skb->len)); frag_header.total_size = tmp___1; ether_addr_copy((u8 *)(& frag_header.orig), (u8 const *)(primary_if->net_dev)->dev_addr); ether_addr_copy((u8 *)(& frag_header.dest), (u8 const *)(& orig_node->orig)); goto ldv_49889; ldv_49888: skb_fragment = batadv_frag_create(skb, & frag_header, mtu); if ((unsigned long )skb_fragment == (unsigned long )((struct sk_buff *)0)) { goto out_err; } else { } batadv_add_counter___2(bat_priv, 11UL, 1UL); batadv_add_counter___2(bat_priv, 12UL, (size_t )(skb_fragment->len + 14U)); batadv_send_skb_packet(skb_fragment, neigh_node->if_incoming, (uint8_t const *)(& neigh_node->addr)); frag_header.no = (unsigned char )((int )frag_header.no + 1); if ((unsigned int )*((unsigned char *)(& frag_header) + 3UL) == 240U) { goto out_err; } else { } ldv_49889: ; if (skb->len > max_fragment_size) { goto ldv_49888; } else { } tmp___2 = batadv_skb_head_push(skb, header_size); if (tmp___2 < 0) { goto out_err; } else { tmp___3 = ldv_pskb_expand_head_259(skb, (int )(header_size + 14U), 0, 32U); if (tmp___3 < 0) { goto out_err; } else { } } __len = (size_t )header_size; __ret = __builtin_memcpy((void *)skb->data, (void const *)(& frag_header), __len); batadv_add_counter___2(bat_priv, 11UL, 1UL); batadv_add_counter___2(bat_priv, 12UL, (size_t )(skb->len + 14U)); batadv_send_skb_packet(skb, neigh_node->if_incoming, (uint8_t const *)(& neigh_node->addr)); ret = 1; out_err: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (ret); } } void *ldv_kmem_cache_alloc_240(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_246(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_248(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_250(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_251(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_252(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_253(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_254(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_255(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_256(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_257(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_258(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_259(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } extern int sprintf(char * , char const * , ...) ; __inline static void INIT_HLIST_NODE(struct hlist_node *h ) { { h->next = (struct hlist_node *)0; h->pprev = (struct hlist_node **)0; return; } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_288(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_305(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_296(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_304(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_298(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_294(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_302(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_303(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_299(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_300(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_301(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; int batadv_throw_uevent(struct batadv_priv *bat_priv , enum batadv_uev_type type , enum batadv_uev_action action , char const *data ) ; void batadv_gw_check_client_stop(struct batadv_priv *bat_priv ) ; void batadv_gw_reselect(struct batadv_priv *bat_priv ) ; void batadv_gw_election(struct batadv_priv *bat_priv ) ; struct batadv_orig_node *batadv_gw_get_selected_orig(struct batadv_priv *bat_priv ) ; void batadv_gw_check_election(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) ; void batadv_gw_node_update(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_tvlv_gateway_data *gateway ) ; void batadv_gw_node_delete(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) ; void batadv_gw_node_purge(struct batadv_priv *bat_priv ) ; bool batadv_gw_out_of_range(struct batadv_priv *bat_priv , struct sk_buff *skb ) ; enum batadv_dhcp_recipient batadv_gw_dhcp_recipient_get(struct sk_buff *skb , unsigned int *header_len , uint8_t *chaddr ) ; struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv , uint8_t const *src , uint8_t const *addr , unsigned short vid ) ; static void batadv_gw_node_free_ref(struct batadv_gw_node *gw_node ) { int tmp ; { tmp = atomic_dec_and_test(& gw_node->refcount); if (tmp != 0) { batadv_orig_node_free_ref(gw_node->orig_node); kfree_call_rcu(& gw_node->rcu, (void (*)(struct callback_head * ))48); } else { } return; } } static struct batadv_gw_node *batadv_gw_get_selected_gw_node(struct batadv_priv *bat_priv ) { struct batadv_gw_node *gw_node ; struct batadv_gw_node *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; int tmp___1 ; { rcu_read_lock(); _________p1 = *((struct batadv_gw_node * volatile *)(& bat_priv->gw.curr_gw)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_held(); if (tmp___0 == 0 && 1) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/gateway_client.o.c.prepared", 213, "suspicious rcu_dereference_check() usage"); } else { } } else { } gw_node = _________p1; if ((unsigned long )gw_node == (unsigned long )((struct batadv_gw_node *)0)) { goto out; } else { } tmp___1 = atomic_add_unless(& gw_node->refcount, 1, 0); if (tmp___1 == 0) { gw_node = (struct batadv_gw_node *)0; } else { } out: rcu_read_unlock(); return (gw_node); } } struct batadv_orig_node *batadv_gw_get_selected_orig(struct batadv_priv *bat_priv ) { struct batadv_gw_node *gw_node ; struct batadv_orig_node *orig_node ; int tmp ; { orig_node = (struct batadv_orig_node *)0; gw_node = batadv_gw_get_selected_gw_node(bat_priv); if ((unsigned long )gw_node == (unsigned long )((struct batadv_gw_node *)0)) { goto out; } else { } rcu_read_lock(); orig_node = gw_node->orig_node; if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto unlock; } else { } tmp = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp == 0) { orig_node = (struct batadv_orig_node *)0; } else { } unlock: rcu_read_unlock(); out: ; if ((unsigned long )gw_node != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(gw_node); } else { } return (orig_node); } } extern void __compiletime_assert_262(void) ; static void batadv_gw_select(struct batadv_priv *bat_priv , struct batadv_gw_node *new_gw_node ) { struct batadv_gw_node *curr_gw_node ; int tmp ; int tmp___0 ; bool __cond ; { spin_lock_bh(& bat_priv->gw.list_lock); if ((unsigned long )new_gw_node != (unsigned long )((struct batadv_gw_node *)0)) { tmp = atomic_add_unless(& new_gw_node->refcount, 1, 0); if (tmp == 0) { new_gw_node = (struct batadv_gw_node *)0; } else { } } else { } tmp___0 = debug_lockdep_rcu_enabled(); curr_gw_node = bat_priv->gw.curr_gw; __cond = 0; if ((int )__cond) { __compiletime_assert_262(); } else { } __asm__ volatile ("": : : "memory"); *((struct batadv_gw_node * volatile *)(& bat_priv->gw.curr_gw)) = new_gw_node; if ((unsigned long )curr_gw_node != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw_node); } else { } spin_unlock_bh(& bat_priv->gw.list_lock); return; } } void batadv_gw_reselect(struct batadv_priv *bat_priv ) { { atomic_set(& bat_priv->gw.reselect, 1); return; } } static struct batadv_gw_node *batadv_gw_get_best_gw_node(struct batadv_priv *bat_priv ) { struct batadv_neigh_node *router ; struct batadv_neigh_ifinfo *router_ifinfo ; struct batadv_gw_node *gw_node ; struct batadv_gw_node *curr_gw ; uint32_t max_gw_factor ; uint32_t tmp_gw_factor ; uint32_t gw_divisor ; uint8_t max_tq ; uint8_t tq_avg ; struct batadv_orig_node *orig_node ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_gw_node *tmp___0 ; int tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_gw_node *tmp___4 ; { curr_gw = (struct batadv_gw_node *)0; max_gw_factor = 0U; tmp_gw_factor = 0U; max_tq = 0U; gw_divisor = 4096U; gw_divisor = gw_divisor * 64U; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->gw.list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_gw_node *)__mptr; } else { tmp___0 = (struct batadv_gw_node *)0; } gw_node = tmp___0; goto ldv_49848; ldv_49847: ; if (gw_node->deleted != 0UL) { goto ldv_49842; } else { } orig_node = gw_node->orig_node; router = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )router == (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_49842; } else { } router_ifinfo = batadv_neigh_ifinfo_get(router, (struct batadv_hard_iface *)0); if ((unsigned long )router_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto next; } else { } tmp___1 = atomic_add_unless(& gw_node->refcount, 1, 0); if (tmp___1 == 0) { goto next; } else { } tq_avg = router_ifinfo->bat_iv.tq_avg; tmp___2 = atomic_read((atomic_t const *)(& bat_priv->gw_sel_class)); switch (tmp___2) { case 1: tmp_gw_factor = (uint32_t )((int )tq_avg * (int )tq_avg); tmp_gw_factor = gw_node->bandwidth_down * tmp_gw_factor; tmp_gw_factor = tmp_gw_factor * 10000U; tmp_gw_factor = tmp_gw_factor / gw_divisor; if (tmp_gw_factor > max_gw_factor || (tmp_gw_factor == max_gw_factor && (int )tq_avg > (int )max_tq)) { if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw); } else { } curr_gw = gw_node; atomic_inc(& curr_gw->refcount); } else { } goto ldv_49845; default: ; if ((int )tq_avg > (int )max_tq) { if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw); } else { } curr_gw = gw_node; atomic_inc(& curr_gw->refcount); } else { } goto ldv_49845; } ldv_49845: ; if ((int )tq_avg > (int )max_tq) { max_tq = tq_avg; } else { } if (tmp_gw_factor > max_gw_factor) { max_gw_factor = tmp_gw_factor; } else { } batadv_gw_node_free_ref(gw_node); next: batadv_neigh_node_free_ref(router); if ((unsigned long )router_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_ifinfo); } else { } ldv_49842: _________p1___0 = *((struct hlist_node * volatile *)(& gw_node->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_gw_node *)__mptr___0; } else { tmp___4 = (struct batadv_gw_node *)0; } gw_node = tmp___4; ldv_49848: ; if ((unsigned long )gw_node != (unsigned long )((struct batadv_gw_node *)0)) { goto ldv_49847; } else { } rcu_read_unlock(); return (curr_gw); } } void batadv_gw_check_client_stop(struct batadv_priv *bat_priv ) { struct batadv_gw_node *curr_gw ; int tmp ; { tmp = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); if (tmp != 1) { return; } else { } curr_gw = batadv_gw_get_selected_gw_node(bat_priv); if ((unsigned long )curr_gw == (unsigned long )((struct batadv_gw_node *)0)) { return; } else { } batadv_gw_select(bat_priv, (struct batadv_gw_node *)0); batadv_throw_uevent(bat_priv, 0, 1, (char const *)0); batadv_gw_node_free_ref(curr_gw); return; } } void batadv_gw_election(struct batadv_priv *bat_priv ) { struct batadv_gw_node *curr_gw ; struct batadv_gw_node *next_gw ; struct batadv_neigh_node *router ; struct batadv_neigh_ifinfo *router_ifinfo ; char gw_addr[18U] ; unsigned int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { curr_gw = (struct batadv_gw_node *)0; next_gw = (struct batadv_gw_node *)0; router = (struct batadv_neigh_node *)0; router_ifinfo = (struct batadv_neigh_ifinfo *)0; gw_addr[0] = 0; tmp = 1U; while (1) { if (tmp >= 18U) { break; } else { } gw_addr[tmp] = (char)0; tmp = tmp + 1U; } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); if (tmp___0 != 1) { goto out; } else { } curr_gw = batadv_gw_get_selected_gw_node(bat_priv); tmp___1 = atomic_add_unless(& bat_priv->gw.reselect, -1, 0); if (tmp___1 == 0 && (unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { goto out; } else { } next_gw = batadv_gw_get_best_gw_node(bat_priv); if ((unsigned long )curr_gw == (unsigned long )next_gw) { goto out; } else { } if ((unsigned long )next_gw != (unsigned long )((struct batadv_gw_node *)0)) { sprintf((char *)(& gw_addr), "%pM", (uint8_t *)(& (next_gw->orig_node)->orig)); router = batadv_orig_router_get(next_gw->orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )router == (unsigned long )((struct batadv_neigh_node *)0)) { batadv_gw_reselect(bat_priv); goto out; } else { } router_ifinfo = batadv_neigh_ifinfo_get(router, (struct batadv_hard_iface *)0); if ((unsigned long )router_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_gw_reselect(bat_priv); goto out; } else { } } else { } if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0) && (unsigned long )next_gw == (unsigned long )((struct batadv_gw_node *)0)) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___2 & 1) { batadv_debug_log(bat_priv, "Removing selected gateway - no gateway in range\n"); } else { } batadv_throw_uevent(bat_priv, 0, 1, (char const *)0); } else if ((unsigned long )curr_gw == (unsigned long )((struct batadv_gw_node *)0) && (unsigned long )next_gw != (unsigned long )((struct batadv_gw_node *)0)) { tmp___3 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___3 & 1) { batadv_debug_log(bat_priv, "Adding route to gateway %pM (bandwidth: %u.%u/%u.%u MBit, tq: %i)\n", (uint8_t *)(& (next_gw->orig_node)->orig), next_gw->bandwidth_down / 10U, next_gw->bandwidth_down % 10U, next_gw->bandwidth_up / 10U, next_gw->bandwidth_up % 10U, (int )router_ifinfo->bat_iv.tq_avg); } else { } batadv_throw_uevent(bat_priv, 0, 0, (char const *)(& gw_addr)); } else { tmp___4 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___4 & 1) { batadv_debug_log(bat_priv, "Changing route to gateway %pM (bandwidth: %u.%u/%u.%u MBit, tq: %i)\n", (uint8_t *)(& (next_gw->orig_node)->orig), next_gw->bandwidth_down / 10U, next_gw->bandwidth_down % 10U, next_gw->bandwidth_up / 10U, next_gw->bandwidth_up % 10U, (int )router_ifinfo->bat_iv.tq_avg); } else { } batadv_throw_uevent(bat_priv, 0, 2, (char const *)(& gw_addr)); } batadv_gw_select(bat_priv, next_gw); out: ; if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw); } else { } if ((unsigned long )next_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(next_gw); } else { } if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router); } else { } if ((unsigned long )router_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_ifinfo); } else { } return; } } void batadv_gw_check_election(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct batadv_neigh_ifinfo *router_orig_tq ; struct batadv_neigh_ifinfo *router_gw_tq ; struct batadv_orig_node *curr_gw_orig ; struct batadv_neigh_node *router_gw ; struct batadv_neigh_node *router_orig ; uint8_t gw_tq_avg ; uint8_t orig_tq_avg ; int tmp ; int tmp___0 ; int tmp___1 ; { router_orig_tq = (struct batadv_neigh_ifinfo *)0; router_gw_tq = (struct batadv_neigh_ifinfo *)0; router_gw = (struct batadv_neigh_node *)0; router_orig = (struct batadv_neigh_node *)0; curr_gw_orig = batadv_gw_get_selected_orig(bat_priv); if ((unsigned long )curr_gw_orig == (unsigned long )((struct batadv_orig_node *)0)) { goto reselect; } else { } router_gw = batadv_orig_router_get(curr_gw_orig, (struct batadv_hard_iface const *)0); if ((unsigned long )router_gw == (unsigned long )((struct batadv_neigh_node *)0)) { goto reselect; } else { } router_gw_tq = batadv_neigh_ifinfo_get(router_gw, (struct batadv_hard_iface *)0); if ((unsigned long )router_gw_tq == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto reselect; } else { } if ((unsigned long )curr_gw_orig == (unsigned long )orig_node) { goto out; } else { } router_orig = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )router_orig == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } router_orig_tq = batadv_neigh_ifinfo_get(router_orig, (struct batadv_hard_iface *)0); if ((unsigned long )router_orig_tq == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } gw_tq_avg = router_gw_tq->bat_iv.tq_avg; orig_tq_avg = router_orig_tq->bat_iv.tq_avg; if ((int )orig_tq_avg < (int )gw_tq_avg) { goto out; } else { } tmp = atomic_read((atomic_t const *)(& bat_priv->gw_sel_class)); if (tmp > 3) { tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw_sel_class)); if ((int )orig_tq_avg - (int )gw_tq_avg < tmp___0) { goto out; } else { } } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___1 & 1) { batadv_debug_log(bat_priv, "Restarting gateway selection: better gateway found (tq curr: %i, tq new: %i)\n", (int )gw_tq_avg, (int )orig_tq_avg); } else { } reselect: batadv_gw_reselect(bat_priv); out: ; if ((unsigned long )curr_gw_orig != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(curr_gw_orig); } else { } if ((unsigned long )router_gw != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router_gw); } else { } if ((unsigned long )router_orig != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router_orig); } else { } if ((unsigned long )router_gw_tq != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_gw_tq); } else { } if ((unsigned long )router_orig_tq != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_orig_tq); } else { } return; } } static void batadv_gw_node_add(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_tvlv_gateway_data *gateway ) { struct batadv_gw_node *gw_node ; int tmp ; void *tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; int tmp___5 ; { if (gateway->bandwidth_down == 0U) { return; } else { } tmp = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp == 0) { return; } else { } tmp___0 = kzalloc(64UL, 32U); gw_node = (struct batadv_gw_node *)tmp___0; if ((unsigned long )gw_node == (unsigned long )((struct batadv_gw_node *)0)) { batadv_orig_node_free_ref(orig_node); return; } else { } INIT_HLIST_NODE(& gw_node->list); gw_node->orig_node = orig_node; atomic_set(& gw_node->refcount, 1); spin_lock_bh(& bat_priv->gw.list_lock); hlist_add_head_rcu(& gw_node->list, & bat_priv->gw.list); spin_unlock_bh(& bat_priv->gw.list_lock); tmp___5 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___5 & 1) { tmp___1 = __fswab32(gateway->bandwidth_up); tmp___2 = __fswab32(gateway->bandwidth_up); tmp___3 = __fswab32(gateway->bandwidth_down); tmp___4 = __fswab32(gateway->bandwidth_down); batadv_debug_log(bat_priv, "Found new gateway %pM -> gw bandwidth: %u.%u/%u.%u MBit\n", (uint8_t *)(& orig_node->orig), tmp___4 / 10U, tmp___3 % 10U, tmp___2 / 10U, tmp___1 % 10U); } else { } return; } } static struct batadv_gw_node *batadv_gw_node_get(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct batadv_gw_node *gw_node_tmp ; struct batadv_gw_node *gw_node ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_gw_node *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_gw_node *tmp___3 ; { gw_node = (struct batadv_gw_node *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->gw.list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_gw_node *)__mptr; } else { tmp___0 = (struct batadv_gw_node *)0; } gw_node_tmp = tmp___0; goto ldv_49911; ldv_49910: ; if ((unsigned long )gw_node_tmp->orig_node != (unsigned long )orig_node) { goto ldv_49908; } else { } if (gw_node_tmp->deleted != 0UL) { goto ldv_49908; } else { } tmp___1 = atomic_add_unless(& gw_node_tmp->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_49908; } else { } gw_node = gw_node_tmp; goto ldv_49909; ldv_49908: _________p1___0 = *((struct hlist_node * volatile *)(& gw_node_tmp->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_gw_node *)__mptr___0; } else { tmp___3 = (struct batadv_gw_node *)0; } gw_node_tmp = tmp___3; ldv_49911: ; if ((unsigned long )gw_node_tmp != (unsigned long )((struct batadv_gw_node *)0)) { goto ldv_49910; } else { } ldv_49909: rcu_read_unlock(); return (gw_node); } } void batadv_gw_node_update(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_tvlv_gateway_data *gateway ) { struct batadv_gw_node *gw_node ; struct batadv_gw_node *curr_gw ; __u32 tmp ; __u32 tmp___0 ; __u32 tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; __u32 tmp___4 ; int tmp___5 ; __u32 tmp___6 ; __u32 tmp___7 ; int tmp___8 ; __u32 tmp___9 ; { curr_gw = (struct batadv_gw_node *)0; gw_node = batadv_gw_node_get(bat_priv, orig_node); if ((unsigned long )gw_node == (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_add(bat_priv, orig_node, gateway); goto out; } else { } tmp = __fswab32(gateway->bandwidth_down); if (gw_node->bandwidth_down == tmp) { tmp___0 = __fswab32(gateway->bandwidth_up); if (gw_node->bandwidth_up == tmp___0) { goto out; } else { } } else { } tmp___5 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___5 & 1) { tmp___1 = __fswab32(gateway->bandwidth_up); tmp___2 = __fswab32(gateway->bandwidth_up); tmp___3 = __fswab32(gateway->bandwidth_down); tmp___4 = __fswab32(gateway->bandwidth_down); batadv_debug_log(bat_priv, "Gateway bandwidth of originator %pM changed from %u.%u/%u.%u MBit to %u.%u/%u.%u MBit\n", (uint8_t *)(& orig_node->orig), gw_node->bandwidth_down / 10U, gw_node->bandwidth_down % 10U, gw_node->bandwidth_up / 10U, gw_node->bandwidth_up % 10U, tmp___4 / 10U, tmp___3 % 10U, tmp___2 / 10U, tmp___1 % 10U); } else { } tmp___6 = __fswab32(gateway->bandwidth_down); gw_node->bandwidth_down = tmp___6; tmp___7 = __fswab32(gateway->bandwidth_up); gw_node->bandwidth_up = tmp___7; gw_node->deleted = 0UL; tmp___9 = __fswab32(gateway->bandwidth_down); if (tmp___9 == 0U) { gw_node->deleted = jiffies; tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___8 & 1) { batadv_debug_log(bat_priv, "Gateway %pM removed from gateway list\n", (uint8_t *)(& orig_node->orig)); } else { } curr_gw = batadv_gw_get_selected_gw_node(bat_priv); if ((unsigned long )gw_node == (unsigned long )curr_gw) { batadv_gw_reselect(bat_priv); } else { } } else { } out: ; if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw); } else { } if ((unsigned long )gw_node != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(gw_node); } else { } return; } } void batadv_gw_node_delete(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct batadv_tvlv_gateway_data gateway ; { gateway.bandwidth_down = 0U; gateway.bandwidth_up = 0U; batadv_gw_node_update(bat_priv, orig_node, & gateway); return; } } void batadv_gw_node_purge(struct batadv_priv *bat_priv ) { struct batadv_gw_node *gw_node ; struct batadv_gw_node *curr_gw ; struct hlist_node *node_tmp ; unsigned long timeout ; unsigned long tmp ; int do_reselect ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_gw_node *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_gw_node *tmp___2 ; { tmp = msecs_to_jiffies(400000U); timeout = tmp; do_reselect = 0; curr_gw = batadv_gw_get_selected_gw_node(bat_priv); spin_lock_bh(& bat_priv->gw.list_lock); ____ptr = bat_priv->gw.list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_gw_node *)__mptr; } else { tmp___0 = (struct batadv_gw_node *)0; } gw_node = tmp___0; goto ldv_49950; ldv_49949: ; if (gw_node->deleted == 0UL || (long )((unsigned long )jiffies - (gw_node->deleted + timeout)) < 0L) { tmp___1 = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp___1 == 1) { goto ldv_49948; } else { } } else { } if ((unsigned long )curr_gw == (unsigned long )gw_node) { do_reselect = 1; } else { } hlist_del_rcu(& gw_node->list); batadv_gw_node_free_ref(gw_node); ldv_49948: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_gw_node *)__mptr___0; } else { tmp___2 = (struct batadv_gw_node *)0; } gw_node = tmp___2; ldv_49950: ; if ((unsigned long )gw_node != (unsigned long )((struct batadv_gw_node *)0)) { node_tmp = gw_node->list.next; goto ldv_49949; } else { } spin_unlock_bh(& bat_priv->gw.list_lock); if (do_reselect != 0) { batadv_gw_reselect(bat_priv); } else { } if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw); } else { } return; } } static int batadv_write_buffer_text(struct batadv_priv *bat_priv , struct seq_file *seq , struct batadv_gw_node const *gw_node ) { struct batadv_gw_node *curr_gw ; struct batadv_neigh_node *router ; struct batadv_neigh_ifinfo *router_ifinfo ; int ret ; { router_ifinfo = (struct batadv_neigh_ifinfo *)0; ret = -1; router = batadv_orig_router_get(gw_node->orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )router == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } router_ifinfo = batadv_neigh_ifinfo_get(router, (struct batadv_hard_iface *)0); if ((unsigned long )router_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } curr_gw = batadv_gw_get_selected_gw_node(bat_priv); ret = seq_printf(seq, "%s %pM (%3i) %pM [%10s]: %u.%u/%u.%u MBit\n", (unsigned long )((struct batadv_gw_node const *)curr_gw) == (unsigned long )gw_node ? (char *)"=>" : (char *)" ", (uint8_t *)(& (gw_node->orig_node)->orig), (int )router_ifinfo->bat_iv.tq_avg, (uint8_t *)(& router->addr), (char *)(& ((router->if_incoming)->net_dev)->name), (unsigned int )gw_node->bandwidth_down / 10U, (unsigned int )gw_node->bandwidth_down % 10U, (unsigned int )gw_node->bandwidth_up / 10U, (unsigned int )gw_node->bandwidth_up % 10U); if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw); } else { } out: ; if ((unsigned long )router_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_ifinfo); } else { } if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router); } else { } return (ret); } } int batadv_gw_client_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hard_iface *primary_if ; struct batadv_gw_node *gw_node ; int gw_count ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_gw_node *tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_gw_node *tmp___4 ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; gw_count = 0; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } seq_printf(seq, " %-12s (%s/%i) %17s [%10s]: advertised uplink bandwidth ... [B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n", (char *)"Gateway", (char *)"#", 255, (char *)"Nexthop", (char *)"outgoingIF", (char *)"2014.3.0", (char *)(& (primary_if->net_dev)->name), (primary_if->net_dev)->dev_addr, (char *)(& net_dev->name)); rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->gw.list.first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_gw_node *)__mptr; } else { tmp___1 = (struct batadv_gw_node *)0; } gw_node = tmp___1; goto ldv_49994; ldv_49993: ; if (gw_node->deleted != 0UL) { goto ldv_49992; } else { } tmp___2 = batadv_write_buffer_text(bat_priv, seq, (struct batadv_gw_node const *)gw_node); if (tmp___2 < 0) { goto ldv_49992; } else { } gw_count = gw_count + 1; ldv_49992: _________p1___0 = *((struct hlist_node * volatile *)(& gw_node->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_gw_node *)__mptr___0; } else { tmp___4 = (struct batadv_gw_node *)0; } gw_node = tmp___4; ldv_49994: ; if ((unsigned long )gw_node != (unsigned long )((struct batadv_gw_node *)0)) { goto ldv_49993; } else { } rcu_read_unlock(); if (gw_count == 0) { seq_puts(seq, "No gateways in range ...\n"); } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } enum batadv_dhcp_recipient batadv_gw_dhcp_recipient_get(struct sk_buff *skb , unsigned int *header_len , uint8_t *chaddr ) { enum batadv_dhcp_recipient ret ; struct ethhdr *ethhdr ; struct iphdr *iphdr ; struct ipv6hdr *ipv6hdr ; struct udphdr *udphdr ; struct vlan_ethhdr *vhdr ; int chaddr_offset ; __be16 proto ; uint8_t *p ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; __u16 tmp___4 ; int tmp___5 ; { ret = 0; tmp = pskb_may_pull(skb, *header_len + 14U); if (tmp == 0) { return (0); } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); proto = ethhdr->h_proto; *header_len = *header_len + 14U; if ((unsigned int )proto == 129U) { tmp___0 = pskb_may_pull(skb, *header_len + 4U); if (tmp___0 == 0) { return (0); } else { } vhdr = vlan_eth_hdr((struct sk_buff const *)skb); proto = vhdr->h_vlan_encapsulated_proto; *header_len = *header_len + 4U; } else { } switch ((int )proto) { case 8: tmp___1 = pskb_may_pull(skb, *header_len + 20U); if (tmp___1 == 0) { return (0); } else { } iphdr = (struct iphdr *)skb->data + (unsigned long )*header_len; *header_len = *header_len + (unsigned int )((int )iphdr->ihl * 4); if ((unsigned int )iphdr->protocol != 17U) { return (0); } else { } goto ldv_50011; case 56710: tmp___2 = pskb_may_pull(skb, *header_len + 40U); if (tmp___2 == 0) { return (0); } else { } ipv6hdr = (struct ipv6hdr *)skb->data + (unsigned long )*header_len; *header_len = *header_len + 40U; if ((unsigned int )ipv6hdr->nexthdr != 17U) { return (0); } else { } goto ldv_50011; default: ; return (0); } ldv_50011: tmp___3 = pskb_may_pull(skb, *header_len + 8U); if (tmp___3 == 0) { return (0); } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___4 = __fswab16((int )ethhdr->h_proto); if ((unsigned int )tmp___4 == 33024U) { ethhdr = (struct ethhdr *)skb->data + 4U; } else { } udphdr = (struct udphdr *)skb->data + (unsigned long )*header_len; *header_len = *header_len + 8U; switch ((int )proto) { case 8: ; if ((unsigned int )udphdr->dest == 17152U) { ret = 1; } else if ((unsigned int )udphdr->source == 17152U) { ret = 2; } else { } goto ldv_50015; case 56710: ; if ((unsigned int )udphdr->dest == 8962U) { ret = 1; } else if ((unsigned int )udphdr->source == 8962U) { ret = 2; } else { } goto ldv_50015; } ldv_50015: chaddr_offset = (int )(*header_len + 28U); if ((unsigned int )ret == 2U) { tmp___5 = pskb_may_pull(skb, (unsigned int )(chaddr_offset + 6)); if (tmp___5 != 0) { p = skb->data + ((unsigned long )*header_len + 1UL); if ((unsigned int )*p != 1U) { return (0); } else { } p = skb->data + ((unsigned long )*header_len + 2UL); if ((unsigned int )*p != 6U) { return (0); } else { } ether_addr_copy(chaddr, (u8 const *)skb->data + (unsigned long )chaddr_offset); } else { } } else { } return (ret); } } bool batadv_gw_out_of_range(struct batadv_priv *bat_priv , struct sk_buff *skb ) { struct batadv_neigh_node *neigh_curr ; struct batadv_neigh_node *neigh_old ; struct batadv_orig_node *orig_dst_node ; struct batadv_gw_node *gw_node ; struct batadv_gw_node *curr_gw ; struct batadv_neigh_ifinfo *curr_ifinfo ; struct batadv_neigh_ifinfo *old_ifinfo ; struct ethhdr *ethhdr ; bool out_of_range ; uint8_t curr_tq_avg ; unsigned short vid ; int tmp ; { neigh_curr = (struct batadv_neigh_node *)0; neigh_old = (struct batadv_neigh_node *)0; orig_dst_node = (struct batadv_orig_node *)0; gw_node = (struct batadv_gw_node *)0; curr_gw = (struct batadv_gw_node *)0; ethhdr = (struct ethhdr *)skb->data; out_of_range = 0; vid = batadv_get_vid(skb, 0UL); orig_dst_node = batadv_transtable_search(bat_priv, (uint8_t const *)(& ethhdr->h_source), (uint8_t const *)(& ethhdr->h_dest), (int )vid); if ((unsigned long )orig_dst_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } gw_node = batadv_gw_node_get(bat_priv, orig_dst_node); if (gw_node->bandwidth_down != 0U) { goto out; } else { } tmp = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); switch (tmp) { case 2: curr_tq_avg = 255U; goto ldv_50034; case 1: curr_gw = batadv_gw_get_selected_gw_node(bat_priv); if ((unsigned long )curr_gw == (unsigned long )((struct batadv_gw_node *)0)) { goto out; } else { } if ((unsigned long )curr_gw->orig_node == (unsigned long )orig_dst_node) { goto out; } else { } neigh_curr = batadv_find_router(bat_priv, curr_gw->orig_node, (struct batadv_hard_iface *)0); if ((unsigned long )neigh_curr == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } curr_ifinfo = batadv_neigh_ifinfo_get(neigh_curr, (struct batadv_hard_iface *)0); if ((unsigned long )curr_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } curr_tq_avg = curr_ifinfo->bat_iv.tq_avg; batadv_neigh_ifinfo_free_ref(curr_ifinfo); goto ldv_50034; case 0: ; default: ; goto out; } ldv_50034: neigh_old = batadv_find_router(bat_priv, orig_dst_node, (struct batadv_hard_iface *)0); if ((unsigned long )neigh_old == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } old_ifinfo = batadv_neigh_ifinfo_get(neigh_old, (struct batadv_hard_iface *)0); if ((unsigned long )old_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } if ((int )curr_tq_avg - (int )old_ifinfo->bat_iv.tq_avg > 50) { out_of_range = 1; } else { } batadv_neigh_ifinfo_free_ref(old_ifinfo); out: ; if ((unsigned long )orig_dst_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_dst_node); } else { } if ((unsigned long )curr_gw != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(curr_gw); } else { } if ((unsigned long )gw_node != (unsigned long )((struct batadv_gw_node *)0)) { batadv_gw_node_free_ref(gw_node); } else { } if ((unsigned long )neigh_old != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(neigh_old); } else { } if ((unsigned long )neigh_curr != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(neigh_curr); } else { } return (out_of_range); } } void *ldv_kmem_cache_alloc_288(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_294(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_296(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_298(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_299(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_300(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_301(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_302(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_303(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_304(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_305(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } extern int kstrtoll(char const * , unsigned int , long long * ) ; __inline static int kstrtol(char const *s , unsigned int base , long *res ) { int tmp ; { tmp = kstrtoll(s, base, (long long *)res); return (tmp); } } extern size_t strlen(char const * ) ; extern int strnicmp(char const * , char const * , __kernel_size_t ) ; extern char *strchr(char const * , int ) ; void *ldv_kmem_cache_alloc_332(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_349(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_340(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_348(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_342(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_338(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_346(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_347(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_343(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_344(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_345(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev , char *buff , size_t count ) ; void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv ) ; void batadv_gw_init(struct batadv_priv *bat_priv ) ; void batadv_gw_free(struct batadv_priv *bat_priv ) ; static bool batadv_parse_gw_bandwidth(struct net_device *net_dev , char *buff , uint32_t *down___0 , uint32_t *up___0 ) { enum batadv_bandwidth_units bw_unit_type ; char *slash_ptr ; char *tmp_ptr ; long ldown ; long lup ; int ret ; size_t tmp ; int tmp___0 ; int tmp___1 ; size_t tmp___2 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___3 ; int tmp___4 ; size_t tmp___5 ; int tmp___6 ; int tmp___7 ; size_t tmp___8 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___9 ; int tmp___10 ; { bw_unit_type = 0; slash_ptr = strchr((char const *)buff, 47); if ((unsigned long )slash_ptr != (unsigned long )((char *)0)) { *slash_ptr = 0; } else { } tmp___2 = strlen((char const *)buff); if (tmp___2 > 4UL) { tmp = strlen((char const *)buff); tmp_ptr = buff + (tmp + 0xfffffffffffffffcUL); tmp___0 = strnicmp((char const *)tmp_ptr, "mbit", 4UL); if (tmp___0 == 0) { bw_unit_type = 1; } else { } tmp___1 = strnicmp((char const *)tmp_ptr, "kbit", 4UL); if (tmp___1 == 0 || (unsigned int )bw_unit_type == 1U) { *tmp_ptr = 0; } else { } } else { } ret = kstrtol((char const *)buff, 10U, & ldown); if (ret != 0) { _netdev = net_dev; tmp___3 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___3; tmp___4 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___4 & 63) != 0) { batadv_debug_log(_batpriv, "Download speed of gateway mode invalid: %s\n", buff); } else { } printk("\vbatman_adv: %s: Download speed of gateway mode invalid: %s\n", (char *)(& _netdev->name), buff); return (0); } else { } switch ((unsigned int )bw_unit_type) { case 1U: *down___0 = (uint32_t )ldown * 10U; goto ldv_49422; case 0U: ; default: *down___0 = (uint32_t )(ldown / 100L); goto ldv_49422; } ldv_49422: ; if ((unsigned long )slash_ptr != (unsigned long )((char *)0)) { bw_unit_type = 0; tmp___8 = strlen((char const *)slash_ptr + 1U); if (tmp___8 > 4UL) { tmp___5 = strlen((char const *)slash_ptr + 1U); tmp_ptr = slash_ptr + (tmp___5 + 0xfffffffffffffffdUL); tmp___6 = strnicmp((char const *)tmp_ptr, "mbit", 4UL); if (tmp___6 == 0) { bw_unit_type = 1; } else { } tmp___7 = strnicmp((char const *)tmp_ptr, "kbit", 4UL); if (tmp___7 == 0 || (unsigned int )bw_unit_type == 1U) { *tmp_ptr = 0; } else { } } else { } ret = kstrtol((char const *)slash_ptr + 1U, 10U, & lup); if (ret != 0) { _netdev___0 = net_dev; tmp___9 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___9; tmp___10 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___10 & 63) != 0) { batadv_debug_log(_batpriv___0, "Upload speed of gateway mode invalid: %s\n", slash_ptr + 1UL); } else { } printk("\vbatman_adv: %s: Upload speed of gateway mode invalid: %s\n", (char *)(& _netdev___0->name), slash_ptr + 1UL); return (0); } else { } switch ((unsigned int )bw_unit_type) { case 1U: *up___0 = (uint32_t )lup * 10U; goto ldv_49428; case 0U: ; default: *up___0 = (uint32_t )(lup / 100L); goto ldv_49428; } ldv_49428: ; } else { } return (1); } } void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv ) { struct batadv_tvlv_gateway_data gw ; uint32_t down___0 ; uint32_t up___0 ; char gw_mode ; int tmp ; int tmp___0 ; int tmp___1 ; __u32 tmp___2 ; __u32 tmp___3 ; { tmp = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); gw_mode = (char )tmp; switch ((int )gw_mode) { case 0: ; case 1: batadv_tvlv_container_unregister(bat_priv, 1, 1); goto ldv_49440; case 2: tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw.bandwidth_down)); down___0 = (uint32_t )tmp___0; tmp___1 = atomic_read((atomic_t const *)(& bat_priv->gw.bandwidth_up)); up___0 = (uint32_t )tmp___1; tmp___2 = __fswab32(down___0); gw.bandwidth_down = tmp___2; tmp___3 = __fswab32(up___0); gw.bandwidth_up = tmp___3; batadv_tvlv_container_register(bat_priv, 1, 1, (void *)(& gw), 8); goto ldv_49440; } ldv_49440: ; return; } } ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev , char *buff , size_t count ) { struct batadv_priv *bat_priv ; void *tmp ; uint32_t down_curr ; uint32_t up_curr ; uint32_t down_new ; uint32_t up_new ; bool ret ; int tmp___0 ; int tmp___1 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___2 ; int tmp___3 ; { tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; down_new = 0U; up_new = 0U; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw.bandwidth_down)); down_curr = (unsigned int )tmp___0; tmp___1 = atomic_read((atomic_t const *)(& bat_priv->gw.bandwidth_up)); up_curr = (unsigned int )tmp___1; ret = batadv_parse_gw_bandwidth(net_dev, buff, & down_new, & up_new); if (! ret) { goto end; } else { } if (down_new == 0U) { down_new = 1U; } else { } if (up_new == 0U) { up_new = down_new / 5U; } else { } if (up_new == 0U) { up_new = 1U; } else { } if (down_curr == down_new && up_curr == up_new) { return ((ssize_t )count); } else { } batadv_gw_reselect(bat_priv); _netdev = net_dev; tmp___2 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___2; tmp___3 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___3 & 63) != 0) { batadv_debug_log(_batpriv, "Changing gateway bandwidth from: \'%u.%u/%u.%u MBit\' to: \'%u.%u/%u.%u MBit\'\n", down_curr / 10U, down_curr % 10U, up_curr / 10U, up_curr % 10U, down_new / 10U, down_new % 10U, up_new / 10U, up_new % 10U); } else { } printk("\016batman_adv: %s: Changing gateway bandwidth from: \'%u.%u/%u.%u MBit\' to: \'%u.%u/%u.%u MBit\'\n", (char *)(& _netdev->name), down_curr / 10U, down_curr % 10U, up_curr / 10U, up_curr % 10U, down_new / 10U, down_new % 10U, up_new / 10U, up_new % 10U); atomic_set(& bat_priv->gw.bandwidth_down, (int )down_new); atomic_set(& bat_priv->gw.bandwidth_up, (int )up_new); batadv_gw_tvlv_container_update(bat_priv); end: ; return ((ssize_t )count); } } static void batadv_gw_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t flags , void *tvlv_value , uint16_t tvlv_value_len ) { struct batadv_tvlv_gateway_data gateway ; struct batadv_tvlv_gateway_data *gateway_ptr ; int tmp ; int tmp___0 ; { if (((int )flags & 2) != 0 || (unsigned int )tvlv_value_len <= 7U) { gateway.bandwidth_down = 0U; gateway.bandwidth_up = 0U; } else { gateway_ptr = (struct batadv_tvlv_gateway_data *)tvlv_value; gateway.bandwidth_down = gateway_ptr->bandwidth_down; gateway.bandwidth_up = gateway_ptr->bandwidth_up; if (gateway.bandwidth_down == 0U || gateway.bandwidth_up == 0U) { gateway.bandwidth_down = 0U; gateway.bandwidth_up = 0U; } else { } } batadv_gw_node_update(bat_priv, orig, & gateway); if (gateway.bandwidth_down != 0U) { tmp = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); if (tmp == 1) { tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw_sel_class)); if (tmp___0 > 2) { batadv_gw_check_election(bat_priv, orig); } else { } } else { } } else { } return; } } void batadv_gw_init(struct batadv_priv *bat_priv ) { { batadv_tvlv_handler_register(bat_priv, & batadv_gw_tvlv_ogm_handler_v1, (int (*)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ))0, 1, 1, 2); return; } } void batadv_gw_free(struct batadv_priv *bat_priv ) { { batadv_tvlv_container_unregister(bat_priv, 1, 1); batadv_tvlv_handler_unregister(bat_priv, 1, 1); return; } } void *ldv_kmem_cache_alloc_332(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_338(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_340(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_342(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_343(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_344(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_345(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_346(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_347(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_348(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_349(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } extern void dump_stack(void) ; extern void __list_del_entry(struct list_head * ) ; extern bool queue_work_on(int , struct workqueue_struct * , struct work_struct * ) ; __inline static bool queue_work(struct workqueue_struct *wq , struct work_struct *work ) { bool tmp ; { tmp = queue_work_on(8192, wq, work); return (tmp); } } void *ldv_kmem_cache_alloc_376(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_393(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; int ldv_state_variable_24 ; extern void __list_add_rcu(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add_tail_rcu(struct list_head *new , struct list_head *head ) { { __list_add_rcu(new, head->prev, head); return; } } __inline static void list_del_rcu(struct list_head *entry ) { { __list_del_entry(entry); entry->prev = (struct list_head *)-2401263026316508672L; return; } } struct sk_buff *ldv_skb_clone_384(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_392(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_386(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_382(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_390(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_391(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_387(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_388(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_389(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; extern struct net init_net ; __inline static struct net_device *netdev_notifier_info_to_dev(struct netdev_notifier_info const *info ) { { return ((struct net_device *)info->dev); } } extern void dev_add_pack(struct packet_type * ) ; extern void dev_remove_pack(struct packet_type * ) ; extern struct net_device *dev_get_by_name(struct net * , char const * ) ; extern struct net_device *__dev_get_by_index(struct net * , int ) ; __inline static void dev_put(struct net_device *dev ) { void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; { __vpp_verify = (void const *)0; switch (4UL) { case 1UL: pao_ID__ = -1; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (-1)); } goto ldv_40955; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40955; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40955; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (-1)); } goto ldv_40955; default: __bad_percpu_size(); } ldv_40955: ; goto ldv_40960; case 2UL: pao_ID_____0 = -1; switch (4UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (-1)); } goto ldv_40966; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40966; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40966; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (-1)); } goto ldv_40966; default: __bad_percpu_size(); } ldv_40966: ; goto ldv_40960; case 4UL: pao_ID_____1 = -1; switch (4UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (-1)); } goto ldv_40976; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40976; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40976; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (-1)); } goto ldv_40976; default: __bad_percpu_size(); } ldv_40976: ; goto ldv_40960; case 8UL: pao_ID_____2 = -1; switch (4UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (-1)); } goto ldv_40986; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40986; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (-1)); } goto ldv_40986; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (-1)); } goto ldv_40986; default: __bad_percpu_size(); } ldv_40986: ; goto ldv_40960; default: __bad_size_call_parameter(); goto ldv_40960; } ldv_40960: ; return; } } __inline static void dev_hold(struct net_device *dev ) { void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; { __vpp_verify = (void const *)0; switch (4UL) { case 1UL: pao_ID__ = 1; switch (4UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (1)); } goto ldv_41001; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41001; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41001; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (1)); } goto ldv_41001; default: __bad_percpu_size(); } ldv_41001: ; goto ldv_41006; case 2UL: pao_ID_____0 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (1)); } goto ldv_41012; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41012; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41012; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (1)); } goto ldv_41012; default: __bad_percpu_size(); } ldv_41012: ; goto ldv_41006; case 4UL: pao_ID_____1 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (1)); } goto ldv_41022; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41022; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41022; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (1)); } goto ldv_41022; default: __bad_percpu_size(); } ldv_41022: ; goto ldv_41006; case 8UL: pao_ID_____2 = 1; switch (4UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "qi" (1)); } goto ldv_41032; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41032; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "ri" (1)); } goto ldv_41032; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(dev->pcpu_refcnt))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(dev->pcpu_refcnt)): "re" (1)); } goto ldv_41032; default: __bad_percpu_size(); } ldv_41032: ; goto ldv_41006; default: __bad_size_call_parameter(); goto ldv_41006; } ldv_41006: ; return; } } extern struct net_device *netdev_master_upper_dev_get(struct net_device * ) ; extern int netdev_master_upper_dev_link(struct net_device * , struct net_device * ) ; extern void netdev_upper_dev_unlink(struct net_device * , struct net_device * ) ; extern void rtnl_lock(void) ; extern void rtnl_unlock(void) ; extern int rtnl_is_locked(void) ; int batadv_max_header_len(void) ; int batadv_batman_skb_recv(struct sk_buff *skb , struct net_device *dev , struct packet_type *ptype , struct net_device *orig_dev ) ; void batadv_purge_orig_ref(struct batadv_priv *bat_priv ) ; int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface , int max_if_num ) ; int batadv_orig_hash_del_if(struct batadv_hard_iface *hard_iface , int max_if_num ) ; __inline static uint32_t batadv_choose_orig___2(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49511; ldv_49510: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49511: ; if (i <= 5UL) { goto ldv_49510; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static void batadv_dat_init_own_addr(struct batadv_priv *bat_priv , struct batadv_hard_iface *primary_if ) { uint32_t addr ; { addr = batadv_choose_orig___2((void const *)(primary_if->net_dev)->dev_addr, 65535U); bat_priv->dat.addr = (unsigned short )addr; return; } } struct notifier_block batadv_hard_if_notifier ; struct batadv_hard_iface *batadv_hardif_get_by_netdev(struct net_device const *net_dev ) ; int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface , char const *iface_name ) ; void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface , enum batadv_hard_if_cleanup autodel ) ; void batadv_hardif_remove_interfaces(void) ; int batadv_hardif_min_mtu(struct net_device *soft_iface ) ; void batadv_update_min_mtu(struct net_device *soft_iface ) ; struct net_device *batadv_softif_create(char const *name ) ; void batadv_softif_destroy_sysfs(struct net_device *soft_iface ) ; int batadv_softif_is_valid(struct net_device const *net_dev ) ; int batadv_softif_create_vlan(struct batadv_priv *bat_priv , unsigned short vid ) ; void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface ) ; void batadv_purge_outstanding_packets(struct batadv_priv *bat_priv , struct batadv_hard_iface const *hard_iface ) ; void batadv_tt_local_resize_to_mtu(struct net_device *soft_iface ) ; int batadv_sysfs_add_meshif(struct net_device *dev ) ; int batadv_sysfs_add_hardif(struct kobject **hardif_obj , struct net_device *dev ) ; void batadv_sysfs_del_hardif(struct kobject **hardif_obj ) ; void batadv_hardif_free_rcu(struct callback_head *rcu ) { struct batadv_hard_iface *hard_iface ; struct callback_head const *__mptr ; { __mptr = (struct callback_head const *)rcu; hard_iface = (struct batadv_hard_iface *)__mptr + 0xffffffffffffff88UL; dev_put(hard_iface->net_dev); kfree((void const *)hard_iface); return; } } struct batadv_hard_iface *batadv_hardif_get_by_netdev(struct net_device const *net_dev ) { struct batadv_hard_iface *hard_iface ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; { rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface *)__mptr; goto ldv_49952; ldv_49951: ; if ((unsigned long )((struct net_device const *)hard_iface->net_dev) == (unsigned long )net_dev) { tmp___0 = atomic_add_unless(& hard_iface->refcount, 1, 0); if (tmp___0 != 0) { goto out; } else { } } else { } __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface *)__mptr___0; ldv_49952: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_49951; } else { } hard_iface = (struct batadv_hard_iface *)0; out: rcu_read_unlock(); return (hard_iface); } } static bool batadv_is_on_batman_iface(struct net_device const *net_dev ) { struct net_device *parent_dev ; bool ret ; int tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; { tmp = batadv_softif_is_valid(net_dev); if (tmp != 0) { return (1); } else { } if ((int )net_dev->iflink == 0 || (int )net_dev->iflink == (int )net_dev->ifindex) { return (0); } else { } parent_dev = __dev_get_by_index(& init_net, net_dev->iflink); __ret_warn_on = (unsigned long )parent_dev == (unsigned long )((struct net_device *)0); tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_fmt("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/hard-interface.o.c.prepared", 248, "Cannot find parent device"); } else { } tmp___1 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___1 != 0L) { return (0); } else { } ret = batadv_is_on_batman_iface((struct net_device const *)parent_dev); return (ret); } } static int batadv_is_valid_iface(struct net_device const *net_dev ) { bool tmp ; { if (((unsigned int )net_dev->flags & 8U) != 0U) { return (0); } else { } if ((unsigned int )((unsigned short )net_dev->type) != 1U) { return (0); } else { } if ((unsigned int )((unsigned char )net_dev->addr_len) != 6U) { return (0); } else { } tmp = batadv_is_on_batman_iface(net_dev); if ((int )tmp) { return (0); } else { } return (1); } } bool batadv_is_wifi_netdev(struct net_device *net_device ) { { if ((unsigned long )net_device == (unsigned long )((struct net_device *)0)) { return (0); } else { } if ((unsigned long )net_device->wireless_handlers != (unsigned long )((struct iw_handler_def const *)0)) { return (1); } else { } if ((unsigned long )net_device->ieee80211_ptr != (unsigned long )((struct wireless_dev *)0)) { return (1); } else { } return (0); } } static struct batadv_hard_iface *batadv_hardif_get_active(struct net_device const *soft_iface ) { struct batadv_hard_iface *hard_iface ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; { rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface *)__mptr; goto ldv_49988; ldv_49987: ; if ((unsigned long )((struct net_device const *)hard_iface->soft_iface) != (unsigned long )soft_iface) { goto ldv_49985; } else { } if ((int )((signed char )hard_iface->if_status) == 3) { tmp___0 = atomic_add_unless(& hard_iface->refcount, 1, 0); if (tmp___0 != 0) { goto out; } else { } } else { } ldv_49985: __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface *)__mptr___0; ldv_49988: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_49987; } else { } hard_iface = (struct batadv_hard_iface *)0; out: rcu_read_unlock(); return (hard_iface); } } static void batadv_primary_if_update_addr(struct batadv_priv *bat_priv , struct batadv_hard_iface *oldif ) { struct batadv_hard_iface *primary_if ; { primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } batadv_dat_init_own_addr(bat_priv, primary_if); batadv_bla_update_orig_address(bat_priv, primary_if, oldif); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } extern void __compiletime_assert_350(void) ; static void batadv_primary_if_select(struct batadv_priv *bat_priv , struct batadv_hard_iface *new_hard_iface ) { struct batadv_hard_iface *curr_hard_iface ; int tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; bool __cond ; { tmp = rtnl_is_locked(); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { printk("\vRTNL: assertion failed at %s (%d)\n", (char *)"/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/hard-interface.o.c.prepared", 344); dump_stack(); } else { } if ((unsigned long )new_hard_iface != (unsigned long )((struct batadv_hard_iface *)0)) { tmp___1 = atomic_add_unless(& new_hard_iface->refcount, 1, 0); if (tmp___1 == 0) { new_hard_iface = (struct batadv_hard_iface *)0; } else { } } else { } tmp___2 = debug_lockdep_rcu_enabled(); curr_hard_iface = bat_priv->primary_if; __cond = 0; if ((int )__cond) { __compiletime_assert_350(); } else { } __asm__ volatile ("": : : "memory"); *((struct batadv_hard_iface * volatile *)(& bat_priv->primary_if)) = new_hard_iface; if ((unsigned long )new_hard_iface == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } (*((bat_priv->bat_algo_ops)->bat_primary_iface_set))(new_hard_iface); batadv_primary_if_update_addr(bat_priv, curr_hard_iface); out: ; if ((unsigned long )curr_hard_iface != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(curr_hard_iface); } else { } return; } } static bool batadv_hardif_is_iface_up(struct batadv_hard_iface const *hard_iface ) { { if ((int )(hard_iface->net_dev)->flags & 1) { return (1); } else { } return (0); } } static void batadv_check_known_mac_addr(struct net_device const *net_dev ) { struct batadv_hard_iface const *hard_iface ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; { rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface const *)__mptr; goto ldv_50031; ldv_50030: ; if ((int )((signed char )hard_iface->if_status) != 3 && (int )((signed char )hard_iface->if_status) != 4) { goto ldv_50029; } else { } if ((unsigned long )((struct net_device const *)hard_iface->net_dev) == (unsigned long )net_dev) { goto ldv_50029; } else { } tmp___0 = batadv_compare_eth((void const *)(hard_iface->net_dev)->dev_addr, (void const *)net_dev->dev_addr); if (tmp___0 == 0) { goto ldv_50029; } else { } printk("\fbatman_adv: The newly added mac address (%pM) already exists on: %s\n", net_dev->dev_addr, (char *)(& (hard_iface->net_dev)->name)); printk("\fbatman_adv: It is strongly recommended to keep mac addresses unique to avoid problems!\n"); ldv_50029: __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface const *)__mptr___0; ldv_50031: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )((struct list_head const *)(& batadv_hardif_list))) { goto ldv_50030; } else { } rcu_read_unlock(); return; } } int batadv_hardif_min_mtu(struct net_device *soft_iface ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hard_iface const *hard_iface ; int min_mtu ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp___0 ; int __min1 ; int __min2 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; int tmp___2 ; int __min1___0 ; int __min2___0 ; int __min1___1 ; int tmp___3 ; int __min2___1 ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; min_mtu = 2147483647; rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface const *)__mptr; goto ldv_50058; ldv_50057: ; if ((int )((signed char )hard_iface->if_status) != 3 && (int )((signed char )hard_iface->if_status) != 4) { goto ldv_50053; } else { } if ((unsigned long )((struct net_device *)hard_iface->soft_iface) != (unsigned long )soft_iface) { goto ldv_50053; } else { } __min1 = (int )(hard_iface->net_dev)->mtu; __min2 = min_mtu; min_mtu = __min1 < __min2 ? __min1 : __min2; ldv_50053: __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface const *)__mptr___0; ldv_50058: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )((struct list_head const *)(& batadv_hardif_list))) { goto ldv_50057; } else { } rcu_read_unlock(); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->fragmentation)); if (tmp___2 == 0) { goto out; } else { } __min1___0 = min_mtu; __min2___0 = 1400; min_mtu = __min1___0 < __min2___0 ? __min1___0 : __min2___0; min_mtu = (int )((unsigned int )min_mtu - 20U); min_mtu = min_mtu * 16; out: atomic_set(& bat_priv->packet_size_max, min_mtu); tmp___3 = batadv_max_header_len(); __min1___1 = min_mtu - tmp___3; __min2___1 = 1500; return (__min1___1 < __min2___1 ? __min1___1 : __min2___1); } } void batadv_update_min_mtu(struct net_device *soft_iface ) { int tmp ; { tmp = batadv_hardif_min_mtu(soft_iface); soft_iface->mtu = (unsigned int )tmp; batadv_tt_local_resize_to_mtu(soft_iface); return; } } static void batadv_hardif_activate_interface(struct batadv_hard_iface *hard_iface ) { struct batadv_priv *bat_priv ; struct batadv_hard_iface *primary_if ; void *tmp ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___0 ; int tmp___1 ; { primary_if = (struct batadv_hard_iface *)0; if ((int )((signed char )hard_iface->if_status) != 2) { goto out; } else { } tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; (*((bat_priv->bat_algo_ops)->bat_iface_update_mac))(hard_iface); hard_iface->if_status = 4; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { batadv_primary_if_select(bat_priv, hard_iface); } else { } _netdev = hard_iface->soft_iface; tmp___0 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___0; tmp___1 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___1 & 63) != 0) { batadv_debug_log(_batpriv, "Interface activated: %s\n", (char *)(& (hard_iface->net_dev)->name)); } else { } printk("\016batman_adv: %s: Interface activated: %s\n", (char *)(& _netdev->name), (char *)(& (hard_iface->net_dev)->name)); batadv_update_min_mtu(hard_iface->soft_iface); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } static void batadv_hardif_deactivate_interface(struct batadv_hard_iface *hard_iface ) { struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp ; int tmp___0 ; { if ((int )((signed char )hard_iface->if_status) != 3 && (int )((signed char )hard_iface->if_status) != 4) { return; } else { } hard_iface->if_status = 2; _netdev = hard_iface->soft_iface; tmp = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp; tmp___0 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___0 & 63) != 0) { batadv_debug_log(_batpriv, "Interface deactivated: %s\n", (char *)(& (hard_iface->net_dev)->name)); } else { } printk("\016batman_adv: %s: Interface deactivated: %s\n", (char *)(& _netdev->name), (char *)(& (hard_iface->net_dev)->name)); batadv_update_min_mtu(hard_iface->soft_iface); return; } } static int batadv_master_del_slave(struct batadv_hard_iface *slave , struct net_device *master ) { int ret ; { if ((unsigned long )master == (unsigned long )((struct net_device *)0)) { return (0); } else { } ret = -16; if ((unsigned long )(master->netdev_ops)->ndo_del_slave != (unsigned long )((int (*/* const */)(struct net_device * , struct net_device * ))0)) { ret = (*((master->netdev_ops)->ndo_del_slave))(master, slave->net_dev); } else { } return (ret); } } int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface , char const *iface_name ) { struct batadv_priv *bat_priv ; struct net_device *soft_iface ; struct net_device *master ; __be16 ethertype ; int max_header_len ; int tmp ; int ret ; int tmp___0 ; int tmp___1 ; void *tmp___2 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___3 ; int tmp___4 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___5 ; int tmp___6 ; int tmp___7 ; struct net_device *_netdev___1 ; struct batadv_priv *_batpriv___1 ; void *tmp___8 ; int tmp___9 ; int tmp___10 ; struct net_device *_netdev___2 ; struct batadv_priv *_batpriv___2 ; void *tmp___11 ; int tmp___12 ; bool tmp___13 ; { ethertype = 1347U; tmp = batadv_max_header_len(); max_header_len = tmp; if ((int )((signed char )hard_iface->if_status) != 0) { goto out; } else { } tmp___0 = atomic_add_unless(& hard_iface->refcount, 1, 0); if (tmp___0 == 0) { goto out; } else { } soft_iface = dev_get_by_name(& init_net, iface_name); if ((unsigned long )soft_iface == (unsigned long )((struct net_device *)0)) { soft_iface = batadv_softif_create(iface_name); if ((unsigned long )soft_iface == (unsigned long )((struct net_device *)0)) { ret = -12; goto err; } else { } dev_hold(soft_iface); } else { } tmp___1 = batadv_softif_is_valid((struct net_device const *)soft_iface); if (tmp___1 == 0) { printk("\vbatman_adv: Can\'t create batman mesh interface %s: already exists as regular interface\n", (char *)(& soft_iface->name)); ret = -22; goto err_dev; } else { } master = netdev_master_upper_dev_get(hard_iface->net_dev); ret = batadv_master_del_slave(hard_iface, master); if (ret != 0) { goto err_dev; } else { } hard_iface->soft_iface = soft_iface; tmp___2 = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp___2; ret = netdev_master_upper_dev_link(hard_iface->net_dev, soft_iface); if (ret != 0) { goto err_dev; } else { } ret = (*((bat_priv->bat_algo_ops)->bat_iface_enable))(hard_iface); if (ret < 0) { goto err_upper; } else { } hard_iface->if_num = (int16_t )bat_priv->num_ifaces; bat_priv->num_ifaces = (char )((int )bat_priv->num_ifaces + 1); hard_iface->if_status = 2; ret = batadv_orig_hash_add_if(hard_iface, (int )bat_priv->num_ifaces); if (ret < 0) { (*((bat_priv->bat_algo_ops)->bat_iface_disable))(hard_iface); bat_priv->num_ifaces = (char )((int )bat_priv->num_ifaces - 1); hard_iface->if_status = 0; goto err_upper; } else { } hard_iface->batman_adv_ptype.type = ethertype; hard_iface->batman_adv_ptype.func = & batadv_batman_skb_recv; hard_iface->batman_adv_ptype.dev = hard_iface->net_dev; dev_add_pack(& hard_iface->batman_adv_ptype); _netdev = hard_iface->soft_iface; tmp___3 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___3; tmp___4 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___4 & 63) != 0) { batadv_debug_log(_batpriv, "Adding interface: %s\n", (char *)(& (hard_iface->net_dev)->name)); } else { } printk("\016batman_adv: %s: Adding interface: %s\n", (char *)(& _netdev->name), (char *)(& (hard_iface->net_dev)->name)); tmp___7 = atomic_read((atomic_t const *)(& bat_priv->fragmentation)); if (tmp___7 != 0 && (hard_iface->net_dev)->mtu < (unsigned int )(max_header_len + 1500)) { _netdev___0 = hard_iface->soft_iface; tmp___5 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___5; tmp___6 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___6 & 63) != 0) { batadv_debug_log(_batpriv___0, "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %i would solve the problem.\n", (char *)(& (hard_iface->net_dev)->name), (hard_iface->net_dev)->mtu, max_header_len + 1500); } else { } printk("\016batman_adv: %s: The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %i would solve the problem.\n", (char *)(& _netdev___0->name), (char *)(& (hard_iface->net_dev)->name), (hard_iface->net_dev)->mtu, max_header_len + 1500); } else { } tmp___10 = atomic_read((atomic_t const *)(& bat_priv->fragmentation)); if (tmp___10 == 0 && (hard_iface->net_dev)->mtu < (unsigned int )(max_header_len + 1500)) { _netdev___1 = hard_iface->soft_iface; tmp___8 = netdev_priv((struct net_device const *)_netdev___1); _batpriv___1 = (struct batadv_priv *)tmp___8; tmp___9 = atomic_read((atomic_t const *)(& _batpriv___1->log_level)); if ((tmp___9 & 63) != 0) { batadv_debug_log(_batpriv___1, "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %i.\n", (char *)(& (hard_iface->net_dev)->name), (hard_iface->net_dev)->mtu, max_header_len + 1500); } else { } printk("\016batman_adv: %s: The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %i.\n", (char *)(& _netdev___1->name), (char *)(& (hard_iface->net_dev)->name), (hard_iface->net_dev)->mtu, max_header_len + 1500); } else { } tmp___13 = batadv_hardif_is_iface_up((struct batadv_hard_iface const *)hard_iface); if ((int )tmp___13) { batadv_hardif_activate_interface(hard_iface); } else { _netdev___2 = hard_iface->soft_iface; tmp___11 = netdev_priv((struct net_device const *)_netdev___2); _batpriv___2 = (struct batadv_priv *)tmp___11; tmp___12 = atomic_read((atomic_t const *)(& _batpriv___2->log_level)); if ((tmp___12 & 63) != 0) { batadv_debug_log(_batpriv___2, "Not using interface %s (retrying later): interface not active\n", (char *)(& (hard_iface->net_dev)->name)); } else { } printk("\vbatman_adv: %s: Not using interface %s (retrying later): interface not active\n", (char *)(& _netdev___2->name), (char *)(& (hard_iface->net_dev)->name)); } batadv_schedule_bat_ogm(hard_iface); out: ; return (0); err_upper: netdev_upper_dev_unlink(hard_iface->net_dev, soft_iface); err_dev: hard_iface->soft_iface = (struct net_device *)0; dev_put(soft_iface); err: batadv_hardif_free_ref(hard_iface); return (ret); } } void batadv_hardif_disable_interface(struct batadv_hard_iface *hard_iface , enum batadv_hard_if_cleanup autodel ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hard_iface *primary_if ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___0 ; int tmp___1 ; struct batadv_hard_iface *new_if ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; primary_if = (struct batadv_hard_iface *)0; if ((int )((signed char )hard_iface->if_status) == 3) { batadv_hardif_deactivate_interface(hard_iface); } else { } if ((int )((signed char )hard_iface->if_status) != 2) { goto out; } else { } _netdev = hard_iface->soft_iface; tmp___0 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___0; tmp___1 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___1 & 63) != 0) { batadv_debug_log(_batpriv, "Removing interface: %s\n", (char *)(& (hard_iface->net_dev)->name)); } else { } printk("\016batman_adv: %s: Removing interface: %s\n", (char *)(& _netdev->name), (char *)(& (hard_iface->net_dev)->name)); dev_remove_pack(& hard_iface->batman_adv_ptype); bat_priv->num_ifaces = (char )((int )bat_priv->num_ifaces - 1); batadv_orig_hash_del_if(hard_iface, (int )bat_priv->num_ifaces); primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )hard_iface == (unsigned long )primary_if) { new_if = batadv_hardif_get_active((struct net_device const *)hard_iface->soft_iface); batadv_primary_if_select(bat_priv, new_if); if ((unsigned long )new_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(new_if); } else { } } else { } (*((bat_priv->bat_algo_ops)->bat_iface_disable))(hard_iface); hard_iface->if_status = 0; batadv_purge_orig_ref(bat_priv); batadv_purge_outstanding_packets(bat_priv, (struct batadv_hard_iface const *)hard_iface); dev_put(hard_iface->soft_iface); if ((int )((signed char )bat_priv->num_ifaces) == 0) { batadv_gw_check_client_stop(bat_priv); if ((unsigned int )autodel == 1U) { batadv_softif_destroy_sysfs(hard_iface->soft_iface); } else { } } else { } netdev_upper_dev_unlink(hard_iface->net_dev, hard_iface->soft_iface); hard_iface->soft_iface = (struct net_device *)0; batadv_hardif_free_ref(hard_iface); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } static void batadv_hardif_remove_interface_finish(struct work_struct *work ) { struct batadv_hard_iface *hard_iface ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)work; hard_iface = (struct batadv_hard_iface *)__mptr + 0xffffffffffffff68UL; batadv_debugfs_del_hardif(hard_iface); batadv_sysfs_del_hardif(& hard_iface->hardif_obj); batadv_hardif_free_ref(hard_iface); return; } } static struct batadv_hard_iface *batadv_hardif_add_interface(struct net_device *net_dev ) { struct batadv_hard_iface *hard_iface ; int ret ; int tmp ; long tmp___0 ; void *tmp___1 ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; bool tmp___2 ; { tmp = rtnl_is_locked(); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { printk("\vRTNL: assertion failed at %s (%d)\n", (char *)"/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/hard-interface.o.c.prepared", 714); dump_stack(); } else { } ret = batadv_is_valid_iface((struct net_device const *)net_dev); if (ret != 1) { goto out; } else { } dev_hold(net_dev); tmp___1 = kzalloc(240UL, 32U); hard_iface = (struct batadv_hard_iface *)tmp___1; if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0)) { goto release_dev; } else { } ret = batadv_sysfs_add_hardif(& hard_iface->hardif_obj, net_dev); if (ret != 0) { goto free_if; } else { } hard_iface->if_num = -1; hard_iface->net_dev = net_dev; hard_iface->soft_iface = (struct net_device *)0; hard_iface->if_status = 0; ret = batadv_debugfs_add_hardif(hard_iface); if (ret != 0) { goto free_sysfs; } else { } INIT_LIST_HEAD(& hard_iface->list); __init_work(& hard_iface->cleanup_work, 0); __constr_expr_0.counter = 137438953408L; hard_iface->cleanup_work.data = __constr_expr_0; lockdep_init_map(& hard_iface->cleanup_work.lockdep_map, "(&hard_iface->cleanup_work)", & __key, 0); INIT_LIST_HEAD(& hard_iface->cleanup_work.entry); hard_iface->cleanup_work.func = & batadv_hardif_remove_interface_finish; hard_iface->num_bcasts = 1U; tmp___2 = batadv_is_wifi_netdev(net_dev); if ((int )tmp___2) { hard_iface->num_bcasts = 3U; } else { } atomic_set(& hard_iface->refcount, 2); batadv_check_known_mac_addr((struct net_device const *)hard_iface->net_dev); list_add_tail_rcu(& hard_iface->list, & batadv_hardif_list); return (hard_iface); free_sysfs: batadv_sysfs_del_hardif(& hard_iface->hardif_obj); free_if: kfree((void const *)hard_iface); release_dev: dev_put(net_dev); out: ; return ((struct batadv_hard_iface *)0); } } static void batadv_hardif_remove_interface(struct batadv_hard_iface *hard_iface ) { int tmp ; long tmp___0 ; { tmp = rtnl_is_locked(); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { printk("\vRTNL: assertion failed at %s (%d)\n", (char *)"/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/hard-interface.o.c.prepared", 767); dump_stack(); } else { } if ((int )((signed char )hard_iface->if_status) != 0) { batadv_hardif_disable_interface(hard_iface, 1); } else { } if ((int )((signed char )hard_iface->if_status) != 0) { return; } else { } hard_iface->if_status = 1; queue_work(batadv_event_workqueue, & hard_iface->cleanup_work); return; } } void batadv_hardif_remove_interfaces(void) { struct batadv_hard_iface *hard_iface ; struct batadv_hard_iface *hard_iface_tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { rtnl_lock(); __mptr = (struct list_head const *)batadv_hardif_list.next; hard_iface = (struct batadv_hard_iface *)__mptr; __mptr___0 = (struct list_head const *)hard_iface->list.next; hard_iface_tmp = (struct batadv_hard_iface *)__mptr___0; goto ldv_50152; ldv_50151: list_del_rcu(& hard_iface->list); batadv_hardif_remove_interface(hard_iface); hard_iface = hard_iface_tmp; __mptr___1 = (struct list_head const *)hard_iface_tmp->list.next; hard_iface_tmp = (struct batadv_hard_iface *)__mptr___1; ldv_50152: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50151; } else { } rtnl_unlock(); return; } } static int batadv_hard_if_event(struct notifier_block *this , unsigned long event , void *ptr ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_hard_iface *hard_iface ; struct batadv_hard_iface *primary_if ; struct batadv_priv *bat_priv ; void *tmp___0 ; int tmp___1 ; void *tmp___2 ; { tmp = netdev_notifier_info_to_dev((struct netdev_notifier_info const *)ptr); net_dev = tmp; primary_if = (struct batadv_hard_iface *)0; tmp___1 = batadv_softif_is_valid((struct net_device const *)net_dev); if (tmp___1 != 0 && event == 5UL) { batadv_sysfs_add_meshif(net_dev); tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; batadv_softif_create_vlan(bat_priv, 0); return (0); } else { } hard_iface = batadv_hardif_get_by_netdev((struct net_device const *)net_dev); if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0) && event == 5UL) { hard_iface = batadv_hardif_add_interface(net_dev); } else { } if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } switch (event) { case 1UL: batadv_hardif_activate_interface(hard_iface); goto ldv_50165; case 9UL: ; case 2UL: batadv_hardif_deactivate_interface(hard_iface); goto ldv_50165; case 6UL: list_del_rcu(& hard_iface->list); batadv_hardif_remove_interface(hard_iface); goto ldv_50165; case 7UL: ; if ((unsigned long )hard_iface->soft_iface != (unsigned long )((struct net_device *)0)) { batadv_update_min_mtu(hard_iface->soft_iface); } else { } goto ldv_50165; case 8UL: ; if ((int )((signed char )hard_iface->if_status) == 0) { goto hardif_put; } else { } batadv_check_known_mac_addr((struct net_device const *)hard_iface->net_dev); tmp___2 = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp___2; (*((bat_priv->bat_algo_ops)->bat_iface_update_mac))(hard_iface); primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto hardif_put; } else { } if ((unsigned long )hard_iface == (unsigned long )primary_if) { batadv_primary_if_update_addr(bat_priv, (struct batadv_hard_iface *)0); } else { } goto ldv_50165; default: ; goto ldv_50165; } ldv_50165: ; hardif_put: batadv_hardif_free_ref(hard_iface); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } struct notifier_block batadv_hard_if_notifier = {& batadv_hard_if_event, 0, 0}; void ldv_main_exported_24(void) { void *ldvarg72 ; void *tmp ; struct notifier_block *ldvarg71 ; void *tmp___0 ; unsigned long ldvarg73 ; unsigned long tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg72 = tmp; tmp___0 = ldv_zalloc(24UL); ldvarg71 = (struct notifier_block *)tmp___0; tmp___1 = __VERIFIER_nondet_ulong(); ldvarg73 = tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_24 == 1) { batadv_hard_if_event(ldvarg71, ldvarg73, ldvarg72); ldv_state_variable_24 = 1; } else { } goto ldv_50181; default: ldv_stop(); } ldv_50181: ; return; } } void *ldv_kmem_cache_alloc_376(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_382(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_384(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_386(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_387(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_388(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_389(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_390(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_391(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_392(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_393(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } void *ldv_kmem_cache_alloc_420(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_437(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_428(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_436(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_430(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_426(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_434(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_435(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_431(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_432(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_433(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; static void batadv_hash_init(struct batadv_hashtable *hash ) { uint32_t i ; struct lock_class_key __key ; { i = 0U; goto ldv_49444; ldv_49443: (hash->table + (unsigned long )i)->first = (struct hlist_node *)0; spinlock_check(hash->list_locks + (unsigned long )i); __raw_spin_lock_init(& (hash->list_locks + (unsigned long )i)->ldv_6347.rlock, "&(&hash->list_locks[i])->rlock", & __key); i = i + 1U; ldv_49444: ; if (hash->size > i) { goto ldv_49443; } else { } return; } } void batadv_hash_destroy(struct batadv_hashtable *hash ) { { kfree((void const *)hash->list_locks); kfree((void const *)hash->table); kfree((void const *)hash); return; } } struct batadv_hashtable *batadv_hash_new(uint32_t size ) { struct batadv_hashtable *hash ; void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = kmalloc(24UL, 32U); hash = (struct batadv_hashtable *)tmp; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_hashtable *)0); } else { } tmp___0 = kmalloc((unsigned long )size * 8UL, 32U); hash->table = (struct hlist_head *)tmp___0; if ((unsigned long )hash->table == (unsigned long )((struct hlist_head *)0)) { goto free_hash; } else { } tmp___1 = kmalloc((unsigned long )size * 72UL, 32U); hash->list_locks = (spinlock_t *)tmp___1; if ((unsigned long )hash->list_locks == (unsigned long )((spinlock_t *)0)) { goto free_table; } else { } hash->size = size; batadv_hash_init(hash); return (hash); free_table: kfree((void const *)hash->table); free_hash: kfree((void const *)hash); return ((struct batadv_hashtable *)0); } } void batadv_hash_set_lock_class(struct batadv_hashtable *hash , struct lock_class_key *key ) { uint32_t i ; { i = 0U; goto ldv_49461; ldv_49460: lockdep_init_map(& (hash->list_locks + (unsigned long )i)->ldv_6347.ldv_6346.dep_map, "key", key, 0); i = i + 1U; ldv_49461: ; if (hash->size > i) { goto ldv_49460; } else { } return; } } void *ldv_kmem_cache_alloc_420(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_426(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_428(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_430(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_431(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_432(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_433(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_434(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_435(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_436(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_437(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } extern void might_fault(void) ; extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add_tail(struct list_head *new , struct list_head *head ) { { __list_add(new, head->prev, head); return; } } extern void list_del(struct list_head * ) ; __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_464(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_481(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; int ldv_state_variable_23 ; struct file *batadv_fops_group2 ; struct inode *batadv_fops_group1 ; void ldv_file_operations_23(void) ; extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; extern unsigned long _copy_to_user(void * , void const * , unsigned int ) ; extern void __copy_from_user_overflow(void) ; extern void __copy_to_user_overflow(void) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; long tmp___0 ; long tmp___1 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; might_fault(); tmp___0 = ldv__builtin_expect(sz < 0, 1L); if (tmp___0 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { tmp___1 = ldv__builtin_expect((unsigned long )sz >= n, 1L); if (tmp___1 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { __copy_from_user_overflow(); } } return (n); } } __inline static unsigned long copy_to_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; long tmp___0 ; long tmp___1 ; { tmp = __builtin_object_size(from, 0); sz = (int )tmp; might_fault(); tmp___0 = ldv__builtin_expect(sz < 0, 1L); if (tmp___0 != 0L) { n = _copy_to_user(to, from, (unsigned int )n); } else { tmp___1 = ldv__builtin_expect((unsigned long )sz >= n, 1L); if (tmp___1 != 0L) { n = _copy_to_user(to, from, (unsigned int )n); } else { __copy_to_user_overflow(); } } return (n); } } struct sk_buff *ldv_skb_clone_472(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_480(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_474(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_470(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_478(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_479(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_475(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_476(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_477(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *__netdev_alloc_skb_ip_align___0(struct net_device *dev , unsigned int length , gfp_t gfp ) { struct sk_buff *skb ; struct sk_buff *tmp ; { tmp = ldv___netdev_alloc_skb_477(dev, length, gfp); skb = tmp; return (skb); } } __inline static struct sk_buff *netdev_alloc_skb_ip_align___0(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = __netdev_alloc_skb_ip_align___0(dev, length, 32U); return (tmp); } } void batadv_socket_init(void) ; void batadv_socket_receive_packet(struct batadv_icmp_header *icmph , size_t icmp_len ) ; __inline static uint32_t batadv_choose_orig___3(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49687; ldv_49686: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49687: ; if (i <= 5UL) { goto ldv_49686; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find___2(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig___3(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_49721; ldv_49720: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_49718; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49718; } else { } orig_node_tmp = orig_node; goto ldv_49719; ldv_49718: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_49721: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49720; } else { } ldv_49719: rcu_read_unlock(); return (orig_node_tmp); } } static struct batadv_socket_client *batadv_socket_client_hash[256U] ; static void batadv_socket_add_packet(struct batadv_socket_client *socket_client , struct batadv_icmp_header *icmph , size_t icmp_len ) ; void batadv_socket_init(void) { { memset((void *)(& batadv_socket_client_hash), 0, 2048UL); return; } } static int batadv_socket_open(struct inode *inode , struct file *file ) { unsigned int i ; struct batadv_socket_client *socket_client ; bool tmp ; int tmp___0 ; void *tmp___1 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; { tmp = try_module_get(& __this_module); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (-16); } else { } nonseekable_open(inode, file); tmp___1 = kmalloc(192UL, 208U); socket_client = (struct batadv_socket_client *)tmp___1; if ((unsigned long )socket_client == (unsigned long )((struct batadv_socket_client *)0)) { module_put(& __this_module); return (-12); } else { } i = 0U; goto ldv_49785; ldv_49784: ; if ((unsigned long )batadv_socket_client_hash[i] == (unsigned long )((struct batadv_socket_client *)0)) { batadv_socket_client_hash[i] = socket_client; goto ldv_49783; } else { } i = i + 1U; ldv_49785: ; if (i <= 255U) { goto ldv_49784; } else { } ldv_49783: ; if (i == 256U) { printk("\vbatman_adv: Error - can\'t add another packet client: maximum number of clients reached\n"); kfree((void const *)socket_client); module_put(& __this_module); return (-54); } else { } INIT_LIST_HEAD(& socket_client->queue_list); socket_client->queue_len = 0U; socket_client->index = (unsigned char )i; socket_client->bat_priv = (struct batadv_priv *)inode->i_private; spinlock_check(& socket_client->lock); __raw_spin_lock_init(& socket_client->lock.ldv_6347.rlock, "&(&socket_client->lock)->rlock", & __key); __init_waitqueue_head(& socket_client->queue_wait, "&socket_client->queue_wait", & __key___0); file->private_data = (void *)socket_client; return (0); } } static int batadv_socket_release(struct inode *inode , struct file *file ) { struct batadv_socket_client *socket_client ; struct batadv_socket_packet *socket_packet ; struct list_head *list_pos ; struct list_head *list_pos_tmp ; struct list_head const *__mptr ; { socket_client = (struct batadv_socket_client *)file->private_data; spin_lock_bh(& socket_client->lock); list_pos = socket_client->queue_list.next; list_pos_tmp = list_pos->next; goto ldv_49801; ldv_49800: __mptr = (struct list_head const *)list_pos; socket_packet = (struct batadv_socket_packet *)__mptr; list_del(list_pos); kfree((void const *)socket_packet); list_pos = list_pos_tmp; list_pos_tmp = list_pos->next; ldv_49801: ; if ((unsigned long )(& socket_client->queue_list) != (unsigned long )list_pos) { goto ldv_49800; } else { } batadv_socket_client_hash[(int )socket_client->index] = (struct batadv_socket_client *)0; spin_unlock_bh(& socket_client->lock); kfree((void const *)socket_client); module_put(& __this_module); return (0); } } static ssize_t batadv_socket_read(struct file *file , char *buf , size_t count , loff_t *ppos ) { struct batadv_socket_client *socket_client ; struct batadv_socket_packet *socket_packet ; size_t packet_len ; int error ; struct thread_info *tmp ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; int __ret ; wait_queue_t __wait ; long __ret___0 ; long __int ; long tmp___3 ; struct list_head const *__mptr ; size_t _min1 ; size_t _min2 ; unsigned long tmp___4 ; { socket_client = (struct batadv_socket_client *)file->private_data; if ((file->f_flags & 2048U) != 0U && socket_client->queue_len == 0U) { return (-11L); } else { } if ((unsigned long )buf == (unsigned long )((char *)0) || count <= 19UL) { return (-22L); } else { } tmp = current_thread_info(); tmp___0 = __chk_range_not_ok((unsigned long )buf, count, tmp->addr_limit.seg); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } tmp___2 = ldv__builtin_expect((long )tmp___1, 1L); if (tmp___2 == 0L) { return (-14L); } else { } __ret = 0; if (socket_client->queue_len == 0U) { __ret___0 = 0L; INIT_LIST_HEAD(& __wait.task_list); __wait.flags = 0U; ldv_49820: tmp___3 = prepare_to_wait_event(& socket_client->queue_wait, & __wait, 1); __int = tmp___3; if (socket_client->queue_len != 0U) { goto ldv_49819; } else { } if (__int != 0L) { __ret___0 = __int; goto ldv_49819; } else { } schedule(); goto ldv_49820; ldv_49819: finish_wait(& socket_client->queue_wait, & __wait); __ret = (int )__ret___0; } else { } error = __ret; if (error != 0) { return ((ssize_t )error); } else { } spin_lock_bh(& socket_client->lock); __mptr = (struct list_head const *)socket_client->queue_list.next; socket_packet = (struct batadv_socket_packet *)__mptr; list_del(& socket_packet->list); socket_client->queue_len = socket_client->queue_len - 1U; spin_unlock_bh(& socket_client->lock); _min1 = count; _min2 = socket_packet->icmp_len; packet_len = _min1 < _min2 ? _min1 : _min2; tmp___4 = copy_to_user((void *)buf, (void const *)(& socket_packet->icmp_packet), packet_len); error = (int )tmp___4; kfree((void const *)socket_packet); if (error != 0) { return (-14L); } else { } return ((ssize_t )packet_len); } } static ssize_t batadv_socket_write(struct file *file , char const *buff , size_t len , loff_t *off ) { struct batadv_socket_client *socket_client ; struct batadv_priv *bat_priv ; struct batadv_hard_iface *primary_if ; struct sk_buff *skb ; struct batadv_icmp_packet_rr *icmp_packet_rr ; struct batadv_icmp_header *icmp_header ; struct batadv_orig_node *orig_node ; struct batadv_neigh_node *neigh_node ; size_t packet_len ; uint8_t *addr ; int tmp ; unsigned char *tmp___0 ; unsigned long tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; { socket_client = (struct batadv_socket_client *)file->private_data; bat_priv = socket_client->bat_priv; primary_if = (struct batadv_hard_iface *)0; orig_node = (struct batadv_orig_node *)0; neigh_node = (struct batadv_neigh_node *)0; packet_len = 20UL; if (len <= 19UL) { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp & 1) { batadv_debug_log(bat_priv, "Error - can\'t send packet from char device: invalid packet size\n"); } else { } return (-22L); } else { } primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { len = 0xfffffffffffffff2UL; goto out; } else { } if (len > 115UL) { packet_len = 116UL; } else { packet_len = len; } skb = netdev_alloc_skb_ip_align___0((struct net_device *)0, (unsigned int )packet_len + 14U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { len = 0xfffffffffffffff4UL; goto out; } else { } skb->priority = 7U; skb_reserve(skb, 14); tmp___0 = skb_put(skb, (unsigned int )packet_len); icmp_header = (struct batadv_icmp_header *)tmp___0; tmp___1 = copy_from_user((void *)icmp_header, (void const *)buff, packet_len); if (tmp___1 != 0UL) { len = 0xfffffffffffffff2UL; goto free_skb; } else { } if ((unsigned int )icmp_header->packet_type != 67U) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___2 & 1) { batadv_debug_log(bat_priv, "Error - can\'t send packet from char device: got bogus packet type (expected: BAT_ICMP)\n"); } else { } len = 0xffffffffffffffeaUL; goto free_skb; } else { } switch ((int )icmp_header->msg_type) { case 8: ; if (len <= 19UL) { tmp___3 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___3 & 1) { batadv_debug_log(bat_priv, "Error - can\'t send packet from char device: invalid packet size\n"); } else { } len = 0xffffffffffffffeaUL; goto free_skb; } else { } tmp___4 = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp___4 != 1) { goto dst_unreach; } else { } orig_node = batadv_orig_hash_find___2(bat_priv, (void const *)(& icmp_header->dst)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto dst_unreach; } else { } neigh_node = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto dst_unreach; } else { } if ((unsigned long )neigh_node->if_incoming == (unsigned long )((struct batadv_hard_iface *)0)) { goto dst_unreach; } else { } if ((int )((signed char )(neigh_node->if_incoming)->if_status) != 3) { goto dst_unreach; } else { } icmp_packet_rr = (struct batadv_icmp_packet_rr *)icmp_header; if (packet_len == 116UL) { addr = ((neigh_node->if_incoming)->net_dev)->dev_addr; ether_addr_copy((u8 *)(& icmp_packet_rr->rr), (u8 const *)addr); } else { } goto ldv_49848; default: tmp___5 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___5 & 1) { batadv_debug_log(bat_priv, "Error - can\'t send packet from char device: got unknown message type\n"); } else { } len = 0xffffffffffffffeaUL; goto free_skb; } ldv_49848: icmp_header->uid = socket_client->index; if ((unsigned int )icmp_header->version != 15U) { icmp_header->msg_type = 12U; icmp_header->version = 15U; batadv_socket_add_packet(socket_client, icmp_header, packet_len); goto free_skb; } else { } ether_addr_copy((u8 *)(& icmp_header->orig), (u8 const *)(primary_if->net_dev)->dev_addr); batadv_send_skb_packet(skb, neigh_node->if_incoming, (uint8_t const *)(& neigh_node->addr)); goto out; dst_unreach: icmp_header->msg_type = 3U; batadv_socket_add_packet(socket_client, icmp_header, packet_len); free_skb: kfree_skb(skb); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(neigh_node); } else { } if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return ((ssize_t )len); } } static unsigned int batadv_socket_poll(struct file *file , poll_table *wait ) { struct batadv_socket_client *socket_client ; { socket_client = (struct batadv_socket_client *)file->private_data; poll_wait(file, & socket_client->queue_wait, wait); if (socket_client->queue_len != 0U) { return (65U); } else { } return (0U); } } static struct file_operations const batadv_fops = {& __this_module, & no_llseek, & batadv_socket_read, & batadv_socket_write, 0, 0, 0, 0, 0, & batadv_socket_poll, 0, 0, 0, & batadv_socket_open, 0, & batadv_socket_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int batadv_socket_setup(struct batadv_priv *bat_priv ) { struct dentry *d ; { if ((unsigned long )bat_priv->debug_dir == (unsigned long )((struct dentry *)0)) { goto err; } else { } d = debugfs_create_file("socket", 33152, bat_priv->debug_dir, (void *)bat_priv, & batadv_fops); if ((unsigned long )d == (unsigned long )((struct dentry *)0)) { goto err; } else { } return (0); err: ; return (-12); } } static void batadv_socket_add_packet(struct batadv_socket_client *socket_client , struct batadv_icmp_header *icmph , size_t icmp_len ) { struct batadv_socket_packet *socket_packet ; size_t len ; void *tmp ; size_t __len ; void *__ret ; struct list_head const *__mptr ; { tmp = kmalloc(144UL, 32U); socket_packet = (struct batadv_socket_packet *)tmp; if ((unsigned long )socket_packet == (unsigned long )((struct batadv_socket_packet *)0)) { return; } else { } len = icmp_len; if (len > 116UL) { len = 116UL; } else { } INIT_LIST_HEAD(& socket_packet->list); __len = len; __ret = __builtin_memcpy((void *)(& socket_packet->icmp_packet), (void const *)icmph, __len); socket_packet->icmp_len = len; spin_lock_bh(& socket_client->lock); if ((unsigned long )batadv_socket_client_hash[(int )icmph->uid] == (unsigned long )((struct batadv_socket_client *)0)) { spin_unlock_bh(& socket_client->lock); kfree((void const *)socket_packet); return; } else { } list_add_tail(& socket_packet->list, & socket_client->queue_list); socket_client->queue_len = socket_client->queue_len + 1U; if (socket_client->queue_len > 100U) { __mptr = (struct list_head const *)socket_client->queue_list.next; socket_packet = (struct batadv_socket_packet *)__mptr; list_del(& socket_packet->list); kfree((void const *)socket_packet); socket_client->queue_len = socket_client->queue_len - 1U; } else { } spin_unlock_bh(& socket_client->lock); __wake_up(& socket_client->queue_wait, 3U, 1, (void *)0); return; } } void batadv_socket_receive_packet(struct batadv_icmp_header *icmph , size_t icmp_len ) { struct batadv_socket_client *hash ; { hash = batadv_socket_client_hash[(int )icmph->uid]; if ((unsigned long )hash != (unsigned long )((struct batadv_socket_client *)0)) { batadv_socket_add_packet(hash, icmph, icmp_len); } else { } return; } } int ldv_retval_12 ; void ldv_file_operations_23(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(1032UL); batadv_fops_group1 = (struct inode *)tmp; tmp___0 = ldv_zalloc(512UL); batadv_fops_group2 = (struct file *)tmp___0; return; } } void ldv_main_exported_23(void) { size_t ldvarg103 ; size_t tmp ; loff_t *ldvarg99 ; void *tmp___0 ; int ldvarg96 ; int tmp___1 ; loff_t *ldvarg102 ; void *tmp___2 ; loff_t ldvarg97 ; loff_t tmp___3 ; struct poll_table_struct *ldvarg98 ; void *tmp___4 ; size_t ldvarg100 ; size_t tmp___5 ; char *ldvarg101 ; void *tmp___6 ; char *ldvarg104 ; void *tmp___7 ; int tmp___8 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg103 = tmp; tmp___0 = ldv_zalloc(8UL); ldvarg99 = (loff_t *)tmp___0; tmp___1 = __VERIFIER_nondet_int(); ldvarg96 = tmp___1; tmp___2 = ldv_zalloc(8UL); ldvarg102 = (loff_t *)tmp___2; tmp___3 = __VERIFIER_nondet_loff_t(); ldvarg97 = tmp___3; tmp___4 = ldv_zalloc(16UL); ldvarg98 = (struct poll_table_struct *)tmp___4; tmp___5 = __VERIFIER_nondet_size_t(); ldvarg100 = tmp___5; tmp___6 = ldv_zalloc(1UL); ldvarg101 = (char *)tmp___6; tmp___7 = ldv_zalloc(1UL); ldvarg104 = (char *)tmp___7; tmp___8 = __VERIFIER_nondet_int(); switch (tmp___8) { case 0: ; if (ldv_state_variable_23 == 1) { batadv_socket_write(batadv_fops_group2, (char const *)ldvarg104, ldvarg103, ldvarg102); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { batadv_socket_write(batadv_fops_group2, (char const *)ldvarg104, ldvarg103, ldvarg102); ldv_state_variable_23 = 2; } else { } goto ldv_49895; case 1: ; if (ldv_state_variable_23 == 2) { batadv_socket_read(batadv_fops_group2, ldvarg101, ldvarg100, ldvarg99); ldv_state_variable_23 = 2; } else { } goto ldv_49895; case 2: ; if (ldv_state_variable_23 == 1) { batadv_socket_poll(batadv_fops_group2, ldvarg98); ldv_state_variable_23 = 1; } else { } if (ldv_state_variable_23 == 2) { batadv_socket_poll(batadv_fops_group2, ldvarg98); ldv_state_variable_23 = 2; } else { } goto ldv_49895; case 3: ; if (ldv_state_variable_23 == 1) { ldv_retval_12 = batadv_socket_open(batadv_fops_group1, batadv_fops_group2); if (ldv_retval_12 == 0) { ldv_state_variable_23 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_49895; case 4: ; if (ldv_state_variable_23 == 2) { batadv_socket_release(batadv_fops_group1, batadv_fops_group2); ldv_state_variable_23 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_49895; case 5: ; if (ldv_state_variable_23 == 2) { no_llseek(batadv_fops_group2, ldvarg97, ldvarg96); ldv_state_variable_23 = 2; } else { } goto ldv_49895; default: ldv_stop(); } ldv_49895: ; return; } } void *ldv_kmem_cache_alloc_464(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_470(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_472(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_474(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_475(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_476(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_477(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_478(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_479(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_480(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_481(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } extern void __might_sleep(char const * , int , int ) ; extern int strcmp(char const * , char const * ) ; __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; extern struct workqueue_struct *__alloc_workqueue_key(char const * , unsigned int , int , struct lock_class_key * , char const * , ...) ; extern void destroy_workqueue(struct workqueue_struct * ) ; extern void flush_workqueue(struct workqueue_struct * ) ; extern void free_percpu(void * ) ; extern void rcu_barrier(void) ; extern int param_set_copystring(char const * , struct kernel_param const * ) ; extern int param_get_string(char * , struct kernel_param const * ) ; void *ldv_kmem_cache_alloc_508(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_525(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; struct batadv_neigh_node *batadv_batman_iv_group3 ; struct file *batadv_debuginfo_bla_claim_table_group1 ; int ldv_state_variable_20 ; struct kobject *batadv_attr_multicast_mode_group0 ; int ldv_state_variable_30 ; int ldv_state_variable_0 ; struct file *batadv_log_fops_group2 ; struct attribute *batadv_attr_distributed_arp_table_group1 ; int ldv_state_variable_12 ; struct inode *batadv_debuginfo_bla_backbone_table_group0 ; int ldv_state_variable_22 ; int ldv_state_variable_14 ; struct batadv_hard_iface *batadv_batman_iv_group4 ; struct kobject *batadv_attr_log_level_group0 ; struct kobject *batadv_attr_orig_interval_group0 ; struct attribute *batadv_attr_mesh_iface_group1 ; int ldv_state_variable_29 ; int ldv_state_variable_17 ; int ldv_state_variable_19 ; struct attribute *batadv_attr_network_coding_group1 ; int ldv_state_variable_27 ; int ldv_state_variable_9 ; struct inode *batadv_debuginfo_dat_cache_group0 ; struct attribute *batadv_attr_vlan_ap_isolation_group1 ; int ref_cnt ; struct attribute *batadv_attr_fragmentation_group1 ; int ldv_state_variable_7 ; int ldv_state_variable_23 ; struct attribute *batadv_attr_gw_mode_group1 ; struct kobject *batadv_attr_gw_mode_group0 ; int ldv_state_variable_6 ; struct file *batadv_debuginfo_nc_nodes_group1 ; struct attribute *batadv_attr_isolation_mark_group1 ; int ldv_state_variable_26 ; int ldv_state_variable_28 ; struct attribute *batadv_attr_bridge_loop_avoidance_group1 ; struct inode *batadv_debuginfo_transtable_global_group0 ; struct inode *batadv_debuginfo_bla_claim_table_group0 ; struct batadv_orig_node *batadv_batman_iv_group1 ; struct net_device *batadv_link_ops_group0 ; struct attribute *batadv_attr_bonding_group1 ; int ldv_state_variable_3 ; struct kobject *batadv_attr_gw_bandwidth_group0 ; struct file *batadv_debuginfo_bla_backbone_table_group1 ; struct kobject *batadv_attr_network_coding_group0 ; int ldv_state_variable_31 ; struct file *batadv_debuginfo_gateways_group1 ; struct inode *batadv_debuginfo_routing_algos_group0 ; struct attribute *batadv_attr_orig_interval_group1 ; int ldv_state_variable_4 ; struct net_device *batadv_ethtool_ops_group0 ; struct attribute *batadv_attr_gw_bandwidth_group1 ; struct inode *batadv_hardif_debuginfo_originators_group0 ; struct inode *batadv_debuginfo_gateways_group0 ; int ldv_state_variable_36 ; int ldv_state_variable_8 ; struct inode *batadv_log_fops_group1 ; struct kobject *batadv_attr_isolation_mark_group0 ; int ldv_state_variable_15 ; struct file *batadv_hardif_debuginfo_originators_group1 ; int ldv_state_variable_5 ; int ldv_state_variable_21 ; int ldv_state_variable_33 ; int ldv_state_variable_13 ; struct inode *batadv_debuginfo_transtable_local_group0 ; struct kobject *batadv_attr_fragmentation_group0 ; struct kernel_param *batadv_param_ops_ra_group0 ; struct kobject *batadv_attr_mesh_iface_group0 ; struct kobject *batadv_attr_vlan_ap_isolation_group0 ; struct kobject *batadv_attr_gw_sel_class_group0 ; struct attribute *batadv_attr_aggregated_ogms_group1 ; struct attribute *batadv_attr_gw_sel_class_group1 ; struct batadv_hard_iface *batadv_batman_iv_group2 ; struct kobject *batadv_attr_distributed_arp_table_group0 ; struct attribute *batadv_attr_log_level_group1 ; struct kobject *batadv_attr_aggregated_ogms_group0 ; struct attribute *batadv_attr_multicast_mode_group1 ; int ldv_state_variable_24 ; int ldv_state_variable_1 ; struct file *batadv_fops_group2 ; struct file *batadv_debuginfo_originators_group1 ; int ldv_state_variable_10 ; struct inode *batadv_debuginfo_originators_group0 ; struct inode *batadv_debuginfo_nc_nodes_group0 ; int ldv_state_variable_16 ; int ldv_state_variable_2 ; int ldv_state_variable_25 ; struct kobject *batadv_attr_hop_penalty_group0 ; int ldv_state_variable_11 ; int ldv_state_variable_18 ; struct inode *batadv_fops_group1 ; struct kobject *batadv_attr_bonding_group0 ; struct file *batadv_debuginfo_routing_algos_group1 ; struct file *batadv_debuginfo_transtable_local_group1 ; int ldv_state_variable_32 ; int ldv_state_variable_34 ; struct file *batadv_debuginfo_dat_cache_group1 ; struct kobject *batadv_attr_bridge_loop_avoidance_group0 ; struct file *batadv_debuginfo_transtable_global_group1 ; struct net_device *batadv_netdev_ops_group1 ; struct attribute *batadv_attr_hop_penalty_group1 ; struct batadv_neigh_node *batadv_batman_iv_group0 ; int ldv_state_variable_35 ; void ldv_initialize_kernel_param_ops_22(void) ; void ldv_initialize_batadv_attribute_5(void) ; void ldv_initialize_batadv_attribute_9(void) ; void ldv_net_device_ops_20(void) ; void ldv_initialize_ethtool_ops_21(void) ; void ldv_initialize_batadv_attribute_3(void) ; void ldv_initialize_batadv_attribute_14(void) ; void ldv_initialize_batadv_attribute_7(void) ; void ldv_initialize_batadv_attribute_11(void) ; void ldv_initialize_batadv_attribute_8(void) ; void ldv_initialize_batadv_attribute_12(void) ; void ldv_initialize_batadv_attribute_4(void) ; void ldv_initialize_batadv_attribute_10(void) ; void ldv_initialize_batadv_attribute_2(void) ; void ldv_initialize_batadv_attribute_17(void) ; void ldv_initialize_batadv_attribute_16(void) ; void ldv_initialize_rtnl_link_ops_19(void) ; void ldv_initialize_batadv_attribute_18(void) ; void ldv_initialize_batadv_attribute_6(void) ; void ldv_initialize_batadv_attribute_15(void) ; extern u32 crc32c(u32 , void const * , unsigned int ) ; extern void consume_skb(struct sk_buff * ) ; struct sk_buff *ldv_skb_clone_516(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_524(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_518(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_514(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_522(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_523(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; extern void skb_prepare_seq_read(struct sk_buff * , unsigned int , unsigned int , struct skb_seq_state * ) ; extern unsigned int skb_seq_read(unsigned int , u8 const ** , struct skb_seq_state * ) ; __inline static int skb_shared(struct sk_buff const *skb ) { int tmp ; { tmp = atomic_read(& skb->users); return (tmp != 1); } } __inline static struct sk_buff *ldv_skb_share_check_515(struct sk_buff *skb , gfp_t pri ) { struct sk_buff *nskb ; struct sk_buff *tmp ; long tmp___0 ; int tmp___1 ; { if ((pri & 16U) != 0U) { __might_sleep("include/linux/skbuff.h", 1074, 0); } else { } tmp___1 = skb_shared((struct sk_buff const *)skb); if (tmp___1 != 0) { tmp = ldv_skb_clone_516(skb, pri); nskb = tmp; tmp___0 = ldv__builtin_expect((unsigned long )nskb != (unsigned long )((struct sk_buff *)0), 1L); if (tmp___0 != 0L) { consume_skb(skb); } else { kfree_skb(skb); } skb = nskb; } else { } return (skb); } } __inline static struct sk_buff *skb_share_check(struct sk_buff *skb , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_519(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_520(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_521(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static struct sk_buff *__netdev_alloc_skb_ip_align___1(struct net_device *dev , unsigned int length , gfp_t gfp ) { struct sk_buff *skb ; struct sk_buff *tmp ; { tmp = ldv___netdev_alloc_skb_521(dev, length, gfp); skb = tmp; return (skb); } } __inline static struct sk_buff *netdev_alloc_skb_ip_align___1(struct net_device *dev , unsigned int length ) { struct sk_buff *tmp ; { tmp = __netdev_alloc_skb_ip_align___1(dev, length, 32U); return (tmp); } } extern int skb_copy_bits(struct sk_buff const * , int , void * , int ) ; __inline static void *skb_header_pointer(struct sk_buff const *skb , int offset , int len , void *buffer ) { int hlen ; unsigned int tmp ; int tmp___0 ; { tmp = skb_headlen(skb); hlen = (int )tmp; if (hlen - offset >= len) { return ((void *)skb->data + (unsigned long )offset); } else { } tmp___0 = skb_copy_bits(skb, offset, buffer, len); if (tmp___0 < 0) { return ((void *)0); } else { } return (buffer); } } extern int register_netdevice_notifier(struct notifier_block * ) ; extern int unregister_netdevice_notifier(struct notifier_block * ) ; extern int rtnl_link_register(struct rtnl_link_ops * ) ; extern void rtnl_link_unregister(struct rtnl_link_ops * ) ; __inline static __u8 ipv4_get_dsfield(struct iphdr const *iph ) { { return ((__u8 )iph->tos); } } __inline static __u8 ipv6_get_dsfield(struct ipv6hdr const *ipv6h ) { __u16 tmp ; { tmp = __fswab16((int )*((__be16 const *)ipv6h)); return ((__u8 )((int )tmp >> 4)); } } char batadv_routing_algo[20U] ; struct list_head batadv_hardif_list ; struct workqueue_struct *batadv_event_workqueue ; int batadv_mesh_init(struct net_device *soft_iface ) ; void batadv_mesh_free(struct net_device *soft_iface ) ; int batadv_is_my_mac(struct batadv_priv *bat_priv , uint8_t const *addr ) ; void batadv_skb_set_priority(struct sk_buff *skb , int offset ) ; int batadv_algo_select(struct batadv_priv *bat_priv , char *name ) ; int batadv_tvlv_containers_process(struct batadv_priv *bat_priv , bool ogm_source , struct batadv_orig_node *orig_node , uint8_t *src , uint8_t *dst , void *tvlv_value , uint16_t tvlv_value_len ) ; void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv , uint8_t *src , uint8_t *dst , uint8_t type , uint8_t version , void *tvlv_value , uint16_t tvlv_value_len ) ; bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv , unsigned short vid ) ; int batadv_recv_icmp_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; int batadv_recv_unicast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; int batadv_recv_frag_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; int batadv_recv_bcast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; int batadv_recv_unicast_tvlv(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; int batadv_recv_unhandled_unicast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; int batadv_send_skb_to_orig(struct sk_buff *skb , struct batadv_orig_node *orig_node , struct batadv_hard_iface *recv_if ) ; int batadv_originator_init(struct batadv_priv *bat_priv ) ; void batadv_originator_free(struct batadv_priv *bat_priv ) ; __inline static uint32_t batadv_choose_orig___4(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_50598; ldv_50597: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_50598: ; if (i <= 5UL) { goto ldv_50597; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find___3(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig___4(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_50632; ldv_50631: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_50629; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_50629; } else { } orig_node_tmp = orig_node; goto ldv_50630; ldv_50629: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_50632: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_50631; } else { } ldv_50630: rcu_read_unlock(); return (orig_node_tmp); } } struct rtnl_link_ops batadv_link_ops ; void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *softif_vlan ) ; struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv , unsigned short vid ) ; int batadv_tt_init(struct batadv_priv *bat_priv ) ; void batadv_tt_free(struct batadv_priv *bat_priv ) ; void batadv_mcast_init(struct batadv_priv *bat_priv ) ; void batadv_mcast_free(struct batadv_priv *bat_priv ) ; int batadv_nc_init(void) ; int batadv_nc_mesh_init(struct batadv_priv *bat_priv ) ; void batadv_nc_mesh_free(struct batadv_priv *bat_priv ) ; static int (*batadv_rx_handler[256U])(struct sk_buff * , struct batadv_hard_iface * ) ; char batadv_routing_algo[20U] = { 'B', 'A', 'T', 'M', 'A', 'N', '_', 'I', 'V', '\000'}; static struct hlist_head batadv_algo_list ; unsigned char batadv_broadcast_addr[6U] = { 255U, 255U, 255U, 255U, 255U, 255U}; static void batadv_recv_handler_init(void) ; static int batadv_init(void) { struct lock_class_key __key ; char const *__lock_name ; struct workqueue_struct *tmp ; { INIT_LIST_HEAD(& batadv_hardif_list); batadv_algo_list.first = (struct hlist_node *)0; batadv_recv_handler_init(); batadv_iv_init(); batadv_nc_init(); __lock_name = "\"%s\"(\"bat_events\")"; tmp = __alloc_workqueue_key("%s", 10U, 1, & __key, __lock_name, (char *)"bat_events"); batadv_event_workqueue = tmp; if ((unsigned long )batadv_event_workqueue == (unsigned long )((struct workqueue_struct *)0)) { return (-12); } else { } batadv_socket_init(); batadv_debugfs_init(); register_netdevice_notifier(& batadv_hard_if_notifier); rtnl_link_register(& batadv_link_ops); printk("\016batman_adv: B.A.T.M.A.N. advanced %s (compatibility version %i) loaded\n", (char *)"2014.3.0", 15); return (0); } } static void batadv_exit(void) { { batadv_debugfs_destroy(); rtnl_link_unregister(& batadv_link_ops); unregister_netdevice_notifier(& batadv_hard_if_notifier); batadv_hardif_remove_interfaces(); flush_workqueue(batadv_event_workqueue); destroy_workqueue(batadv_event_workqueue); batadv_event_workqueue = (struct workqueue_struct *)0; rcu_barrier(); return; } } int batadv_mesh_init(struct net_device *soft_iface ) { struct batadv_priv *bat_priv ; void *tmp ; int ret ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; struct lock_class_key __key___3 ; struct lock_class_key __key___4 ; struct lock_class_key __key___5 ; struct lock_class_key __key___6 ; struct lock_class_key __key___7 ; struct lock_class_key __key___8 ; struct lock_class_key __key___9 ; struct lock_class_key __key___10 ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; spinlock_check(& bat_priv->forw_bat_list_lock); __raw_spin_lock_init(& bat_priv->forw_bat_list_lock.ldv_6347.rlock, "&(&bat_priv->forw_bat_list_lock)->rlock", & __key); spinlock_check(& bat_priv->forw_bcast_list_lock); __raw_spin_lock_init(& bat_priv->forw_bcast_list_lock.ldv_6347.rlock, "&(&bat_priv->forw_bcast_list_lock)->rlock", & __key___0); spinlock_check(& bat_priv->tt.changes_list_lock); __raw_spin_lock_init(& bat_priv->tt.changes_list_lock.ldv_6347.rlock, "&(&bat_priv->tt.changes_list_lock)->rlock", & __key___1); spinlock_check(& bat_priv->tt.req_list_lock); __raw_spin_lock_init(& bat_priv->tt.req_list_lock.ldv_6347.rlock, "&(&bat_priv->tt.req_list_lock)->rlock", & __key___2); spinlock_check(& bat_priv->tt.roam_list_lock); __raw_spin_lock_init(& bat_priv->tt.roam_list_lock.ldv_6347.rlock, "&(&bat_priv->tt.roam_list_lock)->rlock", & __key___3); spinlock_check(& bat_priv->tt.last_changeset_lock); __raw_spin_lock_init(& bat_priv->tt.last_changeset_lock.ldv_6347.rlock, "&(&bat_priv->tt.last_changeset_lock)->rlock", & __key___4); spinlock_check(& bat_priv->tt.commit_lock); __raw_spin_lock_init(& bat_priv->tt.commit_lock.ldv_6347.rlock, "&(&bat_priv->tt.commit_lock)->rlock", & __key___5); spinlock_check(& bat_priv->gw.list_lock); __raw_spin_lock_init(& bat_priv->gw.list_lock.ldv_6347.rlock, "&(&bat_priv->gw.list_lock)->rlock", & __key___6); spinlock_check(& bat_priv->mcast.want_lists_lock); __raw_spin_lock_init(& bat_priv->mcast.want_lists_lock.ldv_6347.rlock, "&(&bat_priv->mcast.want_lists_lock)->rlock", & __key___7); spinlock_check(& bat_priv->tvlv.container_list_lock); __raw_spin_lock_init(& bat_priv->tvlv.container_list_lock.ldv_6347.rlock, "&(&bat_priv->tvlv.container_list_lock)->rlock", & __key___8); spinlock_check(& bat_priv->tvlv.handler_list_lock); __raw_spin_lock_init(& bat_priv->tvlv.handler_list_lock.ldv_6347.rlock, "&(&bat_priv->tvlv.handler_list_lock)->rlock", & __key___9); spinlock_check(& bat_priv->softif_vlan_list_lock); __raw_spin_lock_init(& bat_priv->softif_vlan_list_lock.ldv_6347.rlock, "&(&bat_priv->softif_vlan_list_lock)->rlock", & __key___10); bat_priv->forw_bat_list.first = (struct hlist_node *)0; bat_priv->forw_bcast_list.first = (struct hlist_node *)0; bat_priv->gw.list.first = (struct hlist_node *)0; bat_priv->mcast.want_all_unsnoopables_list.first = (struct hlist_node *)0; bat_priv->mcast.want_all_ipv4_list.first = (struct hlist_node *)0; bat_priv->mcast.want_all_ipv6_list.first = (struct hlist_node *)0; INIT_LIST_HEAD(& bat_priv->tt.changes_list); INIT_LIST_HEAD(& bat_priv->tt.req_list); INIT_LIST_HEAD(& bat_priv->tt.roam_list); bat_priv->mcast.mla_list.first = (struct hlist_node *)0; bat_priv->tvlv.container_list.first = (struct hlist_node *)0; bat_priv->tvlv.handler_list.first = (struct hlist_node *)0; bat_priv->softif_vlan_list.first = (struct hlist_node *)0; ret = batadv_originator_init(bat_priv); if (ret < 0) { goto err; } else { } ret = batadv_tt_init(bat_priv); if (ret < 0) { goto err; } else { } ret = batadv_bla_init(bat_priv); if (ret < 0) { goto err; } else { } ret = batadv_dat_init(bat_priv); if (ret < 0) { goto err; } else { } ret = batadv_nc_mesh_init(bat_priv); if (ret < 0) { goto err; } else { } batadv_gw_init(bat_priv); batadv_mcast_init(bat_priv); atomic_set(& bat_priv->gw.reselect, 0); atomic_set(& bat_priv->mesh_state, 1); return (0); err: batadv_mesh_free(soft_iface); return (ret); } } void batadv_mesh_free(struct net_device *soft_iface ) { struct batadv_priv *bat_priv ; void *tmp ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; atomic_set(& bat_priv->mesh_state, 2); batadv_purge_outstanding_packets(bat_priv, (struct batadv_hard_iface const *)0); batadv_gw_node_purge(bat_priv); batadv_nc_mesh_free(bat_priv); batadv_dat_free(bat_priv); batadv_bla_free(bat_priv); batadv_mcast_free(bat_priv); batadv_tt_free(bat_priv); batadv_originator_free(bat_priv); batadv_gw_free(bat_priv); free_percpu((void *)bat_priv->bat_counters); bat_priv->bat_counters = (uint64_t *)0ULL; atomic_set(& bat_priv->mesh_state, 0); return; } } int batadv_is_my_mac(struct batadv_priv *bat_priv , uint8_t const *addr ) { struct batadv_hard_iface const *hard_iface ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; { rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface const *)__mptr; goto ldv_51034; ldv_51033: ; if ((int )((signed char )hard_iface->if_status) != 3) { goto ldv_51032; } else { } if ((unsigned long )((struct net_device *)hard_iface->soft_iface) != (unsigned long )bat_priv->soft_iface) { goto ldv_51032; } else { } tmp___0 = batadv_compare_eth((void const *)(hard_iface->net_dev)->dev_addr, (void const *)addr); if (tmp___0 != 0) { rcu_read_unlock(); return (1); } else { } ldv_51032: __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface const *)__mptr___0; ldv_51034: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )((struct list_head const *)(& batadv_hardif_list))) { goto ldv_51033; } else { } rcu_read_unlock(); return (0); } } struct batadv_hard_iface *batadv_seq_print_text_primary_if_get(struct seq_file *seq ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hard_iface *primary_if ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { seq_printf(seq, "BATMAN mesh %s disabled - please specify interfaces to enable it\n", (char *)(& net_dev->name)); goto out; } else { } if ((int )((signed char )primary_if->if_status) == 3) { goto out; } else { } seq_printf(seq, "BATMAN mesh %s disabled - primary interface not active\n", (char *)(& net_dev->name)); batadv_hardif_free_ref(primary_if); primary_if = (struct batadv_hard_iface *)0; out: ; return (primary_if); } } int batadv_max_header_len(void) { int header_len ; int __max1 ; int __max2 ; int __max1___0 ; int __max2___0 ; int __max1___1 ; int __max2___1 ; int __max1___2 ; int __max2___2 ; { header_len = 0; __max1 = header_len; __max2 = 10; header_len = __max1 > __max2 ? __max1 : __max2; __max1___0 = header_len; __max2___0 = 18; header_len = __max1___0 > __max2___0 ? __max1___0 : __max2___0; __max1___1 = header_len; __max2___1 = 14; header_len = __max1___1 > __max2___1 ? __max1___1 : __max2___1; __max1___2 = header_len; __max2___2 = 46; header_len = __max1___2 > __max2___2 ? __max1___2 : __max2___2; return (header_len + 14); } } void batadv_skb_set_priority(struct sk_buff *skb , int offset ) { struct iphdr ip_hdr_tmp ; struct iphdr *ip_hdr___0 ; struct ipv6hdr ip6_hdr_tmp ; struct ipv6hdr *ip6_hdr ; struct ethhdr ethhdr_tmp ; struct ethhdr *ethhdr ; struct vlan_ethhdr *vhdr ; struct vlan_ethhdr vhdr_tmp ; u32 prio ; void *tmp ; void *tmp___0 ; __u16 tmp___1 ; void *tmp___2 ; __u8 tmp___3 ; void *tmp___4 ; __u8 tmp___5 ; { if (skb->priority > 255U && skb->priority <= 263U) { return; } else { } tmp = skb_header_pointer((struct sk_buff const *)skb, offset, 14, (void *)(& ethhdr_tmp)); ethhdr = (struct ethhdr *)tmp; if ((unsigned long )ethhdr == (unsigned long )((struct ethhdr *)0)) { return; } else { } switch ((int )ethhdr->h_proto) { case 129: tmp___0 = skb_header_pointer((struct sk_buff const *)skb, (int )((unsigned int )offset + 18U), 18, (void *)(& vhdr_tmp)); vhdr = (struct vlan_ethhdr *)tmp___0; if ((unsigned long )vhdr == (unsigned long )((struct vlan_ethhdr *)0)) { return; } else { } tmp___1 = __fswab16((int )vhdr->h_vlan_TCI); prio = (u32 )tmp___1 & 57344U; prio = prio >> 13; goto ldv_51073; case 8: tmp___2 = skb_header_pointer((struct sk_buff const *)skb, (int )((unsigned int )offset + 14U), 20, (void *)(& ip_hdr_tmp)); ip_hdr___0 = (struct iphdr *)tmp___2; if ((unsigned long )ip_hdr___0 == (unsigned long )((struct iphdr *)0)) { return; } else { } tmp___3 = ipv4_get_dsfield((struct iphdr const *)ip_hdr___0); prio = (u32 )((int )tmp___3 >> 5); goto ldv_51073; case 56710: tmp___4 = skb_header_pointer((struct sk_buff const *)skb, (int )((unsigned int )offset + 14U), 40, (void *)(& ip6_hdr_tmp)); ip6_hdr = (struct ipv6hdr *)tmp___4; if ((unsigned long )ip6_hdr == (unsigned long )((struct ipv6hdr *)0)) { return; } else { } tmp___5 = ipv6_get_dsfield((struct ipv6hdr const *)ip6_hdr); prio = (u32 )((int )tmp___5 >> 5); goto ldv_51073; default: ; return; } ldv_51073: skb->priority = prio + 256U; return; } } static int batadv_recv_unhandled_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { { return (1); } } int batadv_batman_skb_recv(struct sk_buff *skb , struct net_device *dev , struct packet_type *ptype , struct net_device *orig_dev ) { struct batadv_priv *bat_priv ; struct batadv_ogm_packet *batadv_ogm_packet ; struct batadv_hard_iface *hard_iface ; uint8_t idx ; int ret ; struct packet_type const *__mptr ; int tmp ; long tmp___0 ; long tmp___1 ; unsigned char *tmp___2 ; long tmp___3 ; void *tmp___4 ; int tmp___5 ; int tmp___6 ; { __mptr = (struct packet_type const *)ptype; hard_iface = (struct batadv_hard_iface *)__mptr + 0xffffffffffffffc8UL; skb = skb_share_check(skb, 32U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto err_out; } else { } tmp = pskb_may_pull(skb, 2U); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { goto err_free; } else { } tmp___1 = ldv__builtin_expect((unsigned int )skb->mac_len != 14U, 0L); if (tmp___1 != 0L) { goto err_free; } else { tmp___2 = skb_mac_header((struct sk_buff const *)skb); tmp___3 = ldv__builtin_expect((unsigned long )tmp___2 == (unsigned long )((unsigned char *)0U), 0L); if (tmp___3 != 0L) { goto err_free; } else { } } if ((unsigned long )hard_iface->soft_iface == (unsigned long )((struct net_device *)0)) { goto err_free; } else { } tmp___4 = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp___4; tmp___5 = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp___5 != 1) { goto err_free; } else { } if ((int )((signed char )hard_iface->if_status) != 3) { goto err_free; } else { } batadv_ogm_packet = (struct batadv_ogm_packet *)skb->data; if ((unsigned int )batadv_ogm_packet->version != 15U) { tmp___6 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___6 & 1) { batadv_debug_log(bat_priv, "Drop packet: incompatible batman version (%i)\n", (int )batadv_ogm_packet->version); } else { } goto err_free; } else { } idx = batadv_ogm_packet->packet_type; ret = (*(batadv_rx_handler[(int )idx]))(skb, hard_iface); if (ret == 1) { kfree_skb(skb); } else { } return (0); err_free: kfree_skb(skb); err_out: ; return (1); } } static void batadv_recv_handler_init(void) { int i ; { i = 0; goto ldv_51103; ldv_51102: batadv_rx_handler[i] = & batadv_recv_unhandled_packet; i = i + 1; ldv_51103: ; if ((unsigned int )i <= 255U) { goto ldv_51102; } else { } i = 64; goto ldv_51106; ldv_51105: batadv_rx_handler[i] = & batadv_recv_unhandled_unicast_packet; i = i + 1; ldv_51106: ; if (i <= 127) { goto ldv_51105; } else { } batadv_rx_handler[1] = & batadv_recv_bcast_packet; batadv_rx_handler[66] = & batadv_recv_unicast_packet; batadv_rx_handler[64] = & batadv_recv_unicast_packet; batadv_rx_handler[68] = & batadv_recv_unicast_tvlv; batadv_rx_handler[67] = & batadv_recv_icmp_packet; batadv_rx_handler[65] = & batadv_recv_frag_packet; return; } } int batadv_recv_handler_register(uint8_t packet_type , int (*recv_handler)(struct sk_buff * , struct batadv_hard_iface * ) ) { int (*curr)(struct sk_buff * , struct batadv_hard_iface * ) ; { curr = batadv_rx_handler[(int )packet_type]; if ((unsigned long )curr != (unsigned long )(& batadv_recv_unhandled_packet) && (unsigned long )curr != (unsigned long )(& batadv_recv_unhandled_unicast_packet)) { return (-16); } else { } batadv_rx_handler[(int )packet_type] = recv_handler; return (0); } } void batadv_recv_handler_unregister(uint8_t packet_type ) { { batadv_rx_handler[(int )packet_type] = & batadv_recv_unhandled_packet; return; } } static struct batadv_algo_ops *batadv_algo_get(char *name ) { struct batadv_algo_ops *bat_algo_ops ; struct batadv_algo_ops *bat_algo_ops_tmp ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_algo_ops *tmp ; int tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_algo_ops *tmp___1 ; { bat_algo_ops = (struct batadv_algo_ops *)0; ____ptr = batadv_algo_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_algo_ops *)__mptr; } else { tmp = (struct batadv_algo_ops *)0; } bat_algo_ops_tmp = tmp; goto ldv_51136; ldv_51135: tmp___0 = strcmp((char const *)bat_algo_ops_tmp->name, (char const *)name); if (tmp___0 != 0) { goto ldv_51133; } else { } bat_algo_ops = bat_algo_ops_tmp; goto ldv_51134; ldv_51133: ____ptr___0 = bat_algo_ops_tmp->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_algo_ops *)__mptr___0; } else { tmp___1 = (struct batadv_algo_ops *)0; } bat_algo_ops_tmp = tmp___1; ldv_51136: ; if ((unsigned long )bat_algo_ops_tmp != (unsigned long )((struct batadv_algo_ops *)0)) { goto ldv_51135; } else { } ldv_51134: ; return (bat_algo_ops); } } int batadv_algo_register(struct batadv_algo_ops *bat_algo_ops ) { struct batadv_algo_ops *bat_algo_ops_tmp ; int ret ; { bat_algo_ops_tmp = batadv_algo_get(bat_algo_ops->name); if ((unsigned long )bat_algo_ops_tmp != (unsigned long )((struct batadv_algo_ops *)0)) { printk("\016batman_adv: Trying to register already registered routing algorithm: %s\n", bat_algo_ops->name); ret = -17; goto out; } else { } if ((((((((unsigned long )bat_algo_ops->bat_iface_enable == (unsigned long )((int (*)(struct batadv_hard_iface * ))0) || (unsigned long )bat_algo_ops->bat_iface_disable == (unsigned long )((void (*)(struct batadv_hard_iface * ))0)) || (unsigned long )bat_algo_ops->bat_iface_update_mac == (unsigned long )((void (*)(struct batadv_hard_iface * ))0)) || (unsigned long )bat_algo_ops->bat_primary_iface_set == (unsigned long )((void (*)(struct batadv_hard_iface * ))0)) || (unsigned long )bat_algo_ops->bat_ogm_schedule == (unsigned long )((void (*)(struct batadv_hard_iface * ))0)) || (unsigned long )bat_algo_ops->bat_ogm_emit == (unsigned long )((void (*)(struct batadv_forw_packet * ))0)) || (unsigned long )bat_algo_ops->bat_neigh_cmp == (unsigned long )((int (*)(struct batadv_neigh_node * , struct batadv_hard_iface * , struct batadv_neigh_node * , struct batadv_hard_iface * ))0)) || (unsigned long )bat_algo_ops->bat_neigh_is_equiv_or_better == (unsigned long )((bool (*)(struct batadv_neigh_node * , struct batadv_hard_iface * , struct batadv_neigh_node * , struct batadv_hard_iface * ))0)) { printk("\016batman_adv: Routing algo \'%s\' does not implement required ops\n", bat_algo_ops->name); ret = -22; goto out; } else { } INIT_HLIST_NODE(& bat_algo_ops->list); hlist_add_head(& bat_algo_ops->list, & batadv_algo_list); ret = 0; out: ; return (ret); } } int batadv_algo_select(struct batadv_priv *bat_priv , char *name ) { struct batadv_algo_ops *bat_algo_ops ; int ret ; { ret = -22; bat_algo_ops = batadv_algo_get(name); if ((unsigned long )bat_algo_ops == (unsigned long )((struct batadv_algo_ops *)0)) { goto out; } else { } bat_priv->bat_algo_ops = bat_algo_ops; ret = 0; out: ; return (ret); } } int batadv_algo_seq_print_text(struct seq_file *seq , void *offset ) { struct batadv_algo_ops *bat_algo_ops ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_algo_ops *tmp ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_algo_ops *tmp___0 ; { seq_puts(seq, "Available routing algorithms:\n"); ____ptr = batadv_algo_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_algo_ops *)__mptr; } else { tmp = (struct batadv_algo_ops *)0; } bat_algo_ops = tmp; goto ldv_51164; ldv_51163: seq_printf(seq, "%s\n", bat_algo_ops->name); ____ptr___0 = bat_algo_ops->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_algo_ops *)__mptr___0; } else { tmp___0 = (struct batadv_algo_ops *)0; } bat_algo_ops = tmp___0; ldv_51164: ; if ((unsigned long )bat_algo_ops != (unsigned long )((struct batadv_algo_ops *)0)) { goto ldv_51163; } else { } return (0); } } __be32 batadv_skb_crc32(struct sk_buff *skb , u8 *payload_ptr ) { u32 crc ; unsigned int from ; unsigned int to ; struct skb_seq_state st ; u8 const *data ; unsigned int len ; unsigned int consumed ; __u32 tmp ; { crc = 0U; to = skb->len; consumed = 0U; from = (unsigned int )((long )payload_ptr) - (unsigned int )((long )skb->data); skb_prepare_seq_read(skb, from, to, & st); goto ldv_51178; ldv_51177: crc = crc32c(crc, (void const *)data, len); consumed = consumed + len; ldv_51178: len = skb_seq_read(consumed, & data, & st); if (len != 0U) { goto ldv_51177; } else { } tmp = __fswab32(crc); return (tmp); } } static void batadv_tvlv_handler_free_ref(struct batadv_tvlv_handler *tvlv_handler ) { int tmp ; { tmp = atomic_dec_and_test(& tvlv_handler->refcount); if (tmp != 0) { kfree_call_rcu(& tvlv_handler->rcu, (void (*)(struct callback_head * ))40); } else { } return; } } static struct batadv_tvlv_handler *batadv_tvlv_handler_get(struct batadv_priv *bat_priv , uint8_t type , uint8_t version ) { struct batadv_tvlv_handler *tvlv_handler_tmp ; struct batadv_tvlv_handler *tvlv_handler ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tvlv_handler *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_tvlv_handler *tmp___3 ; { tvlv_handler = (struct batadv_tvlv_handler *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->tvlv.handler_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tvlv_handler *)__mptr; } else { tmp___0 = (struct batadv_tvlv_handler *)0; } tvlv_handler_tmp = tmp___0; goto ldv_51214; ldv_51213: ; if ((int )tvlv_handler_tmp->type != (int )type) { goto ldv_51211; } else { } if ((int )tvlv_handler_tmp->version != (int )version) { goto ldv_51211; } else { } tmp___1 = atomic_add_unless(& tvlv_handler_tmp->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_51211; } else { } tvlv_handler = tvlv_handler_tmp; goto ldv_51212; ldv_51211: _________p1___0 = *((struct hlist_node * volatile *)(& tvlv_handler_tmp->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_tvlv_handler *)__mptr___0; } else { tmp___3 = (struct batadv_tvlv_handler *)0; } tvlv_handler_tmp = tmp___3; ldv_51214: ; if ((unsigned long )tvlv_handler_tmp != (unsigned long )((struct batadv_tvlv_handler *)0)) { goto ldv_51213; } else { } ldv_51212: rcu_read_unlock(); return (tvlv_handler); } } static void batadv_tvlv_container_free_ref(struct batadv_tvlv_container *tvlv ) { int tmp ; { tmp = atomic_dec_and_test(& tvlv->refcount); if (tmp != 0) { kfree((void const *)tvlv); } else { } return; } } static struct batadv_tvlv_container *batadv_tvlv_container_get(struct batadv_priv *bat_priv , uint8_t type , uint8_t version ) { struct batadv_tvlv_container *tvlv_tmp ; struct batadv_tvlv_container *tvlv ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tvlv_container *tmp ; int tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_tvlv_container *tmp___1 ; { tvlv = (struct batadv_tvlv_container *)0; ____ptr = bat_priv->tvlv.container_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tvlv_container *)__mptr; } else { tmp = (struct batadv_tvlv_container *)0; } tvlv_tmp = tmp; goto ldv_51236; ldv_51235: ; if ((int )tvlv_tmp->tvlv_hdr.type != (int )type) { goto ldv_51233; } else { } if ((int )tvlv_tmp->tvlv_hdr.version != (int )version) { goto ldv_51233; } else { } tmp___0 = atomic_add_unless(& tvlv_tmp->refcount, 1, 0); if (tmp___0 == 0) { goto ldv_51233; } else { } tvlv = tvlv_tmp; goto ldv_51234; ldv_51233: ____ptr___0 = tvlv_tmp->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_tvlv_container *)__mptr___0; } else { tmp___1 = (struct batadv_tvlv_container *)0; } tvlv_tmp = tmp___1; ldv_51236: ; if ((unsigned long )tvlv_tmp != (unsigned long )((struct batadv_tvlv_container *)0)) { goto ldv_51235; } else { } ldv_51234: ; return (tvlv); } } static uint16_t batadv_tvlv_container_list_size(struct batadv_priv *bat_priv ) { struct batadv_tvlv_container *tvlv ; uint16_t tvlv_len ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tvlv_container *tmp ; __u16 tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_tvlv_container *tmp___1 ; { tvlv_len = 0U; ____ptr = bat_priv->tvlv.container_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tvlv_container *)__mptr; } else { tmp = (struct batadv_tvlv_container *)0; } tvlv = tmp; goto ldv_51251; ldv_51250: tvlv_len = (unsigned int )tvlv_len + 4U; tmp___0 = __fswab16((int )tvlv->tvlv_hdr.len); tvlv_len = (int )tmp___0 + (int )tvlv_len; ____ptr___0 = tvlv->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_tvlv_container *)__mptr___0; } else { tmp___1 = (struct batadv_tvlv_container *)0; } tvlv = tmp___1; ldv_51251: ; if ((unsigned long )tvlv != (unsigned long )((struct batadv_tvlv_container *)0)) { goto ldv_51250; } else { } return (tvlv_len); } } static void batadv_tvlv_container_remove(struct batadv_tvlv_container *tvlv ) { { if ((unsigned long )tvlv == (unsigned long )((struct batadv_tvlv_container *)0)) { return; } else { } hlist_del(& tvlv->list); batadv_tvlv_container_free_ref(tvlv); batadv_tvlv_container_free_ref(tvlv); return; } } void batadv_tvlv_container_unregister(struct batadv_priv *bat_priv , uint8_t type , uint8_t version ) { struct batadv_tvlv_container *tvlv ; { spin_lock_bh(& bat_priv->tvlv.container_list_lock); tvlv = batadv_tvlv_container_get(bat_priv, (int )type, (int )version); batadv_tvlv_container_remove(tvlv); spin_unlock_bh(& bat_priv->tvlv.container_list_lock); return; } } void batadv_tvlv_container_register(struct batadv_priv *bat_priv , uint8_t type , uint8_t version , void *tvlv_value , uint16_t tvlv_value_len ) { struct batadv_tvlv_container *tvlv_old ; struct batadv_tvlv_container *tvlv_new ; void *tmp ; __u16 tmp___0 ; size_t __len ; __u16 tmp___1 ; void *__ret ; { if ((unsigned long )tvlv_value == (unsigned long )((void *)0)) { tvlv_value_len = 0U; } else { } tmp = kzalloc((unsigned long )tvlv_value_len + 24UL, 32U); tvlv_new = (struct batadv_tvlv_container *)tmp; if ((unsigned long )tvlv_new == (unsigned long )((struct batadv_tvlv_container *)0)) { return; } else { } tvlv_new->tvlv_hdr.version = version; tvlv_new->tvlv_hdr.type = type; tmp___0 = __fswab16((int )tvlv_value_len); tvlv_new->tvlv_hdr.len = tmp___0; tmp___1 = __fswab16((int )tvlv_new->tvlv_hdr.len); __len = (size_t )tmp___1; __ret = __builtin_memcpy((void *)tvlv_new + 1U, (void const *)tvlv_value, __len); INIT_HLIST_NODE(& tvlv_new->list); atomic_set(& tvlv_new->refcount, 1); spin_lock_bh(& bat_priv->tvlv.container_list_lock); tvlv_old = batadv_tvlv_container_get(bat_priv, (int )type, (int )version); batadv_tvlv_container_remove(tvlv_old); hlist_add_head(& tvlv_new->list, & bat_priv->tvlv.container_list); spin_unlock_bh(& bat_priv->tvlv.container_list_lock); return; } } static bool batadv_tvlv_realloc_packet_buff(unsigned char **packet_buff , int *packet_buff_len , int min_packet_len , int additional_packet_len ) { unsigned char *new_buff ; void *tmp ; size_t __len ; void *__ret ; { tmp = kmalloc((size_t )(min_packet_len + additional_packet_len), 32U); new_buff = (unsigned char *)tmp; if ((unsigned long )new_buff != (unsigned long )((unsigned char *)0U)) { __len = (size_t )min_packet_len; __ret = __builtin_memcpy((void *)new_buff, (void const *)*packet_buff, __len); kfree((void const *)*packet_buff); *packet_buff = new_buff; *packet_buff_len = min_packet_len + additional_packet_len; return (1); } else { } return (0); } } uint16_t batadv_tvlv_container_ogm_append(struct batadv_priv *bat_priv , unsigned char **packet_buff , int *packet_buff_len , int packet_min_len ) { struct batadv_tvlv_container *tvlv ; struct batadv_tvlv_hdr *tvlv_hdr ; uint16_t tvlv_value_len ; void *tvlv_value ; bool ret ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tvlv_container *tmp ; size_t __len ; __u16 tmp___0 ; void *__ret ; __u16 tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_tvlv_container *tmp___2 ; { spin_lock_bh(& bat_priv->tvlv.container_list_lock); tvlv_value_len = batadv_tvlv_container_list_size(bat_priv); ret = batadv_tvlv_realloc_packet_buff(packet_buff, packet_buff_len, packet_min_len, (int )tvlv_value_len); if (! ret) { goto end; } else { } if ((unsigned int )tvlv_value_len == 0U) { goto end; } else { } tvlv_value = (void *)*packet_buff + (unsigned long )packet_min_len; ____ptr = bat_priv->tvlv.container_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tvlv_container *)__mptr; } else { tmp = (struct batadv_tvlv_container *)0; } tvlv = tmp; goto ldv_51308; ldv_51307: tvlv_hdr = (struct batadv_tvlv_hdr *)tvlv_value; tvlv_hdr->type = tvlv->tvlv_hdr.type; tvlv_hdr->version = tvlv->tvlv_hdr.version; tvlv_hdr->len = tvlv->tvlv_hdr.len; tvlv_value = (void *)tvlv_hdr + 1U; tmp___0 = __fswab16((int )tvlv->tvlv_hdr.len); __len = (size_t )tmp___0; __ret = __builtin_memcpy(tvlv_value, (void const *)tvlv + 1U, __len); tmp___1 = __fswab16((int )tvlv->tvlv_hdr.len); tvlv_value = tvlv_value + (unsigned long )tmp___1; ____ptr___0 = tvlv->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_tvlv_container *)__mptr___0; } else { tmp___2 = (struct batadv_tvlv_container *)0; } tvlv = tmp___2; ldv_51308: ; if ((unsigned long )tvlv != (unsigned long )((struct batadv_tvlv_container *)0)) { goto ldv_51307; } else { } end: spin_unlock_bh(& bat_priv->tvlv.container_list_lock); return (tvlv_value_len); } } static int batadv_tvlv_call_handler(struct batadv_priv *bat_priv , struct batadv_tvlv_handler *tvlv_handler , bool ogm_source , struct batadv_orig_node *orig_node , uint8_t *src , uint8_t *dst , void *tvlv_value , uint16_t tvlv_value_len ) { int tmp ; { if ((unsigned long )tvlv_handler == (unsigned long )((struct batadv_tvlv_handler *)0)) { return (0); } else { } if ((int )ogm_source) { if ((unsigned long )tvlv_handler->ogm_handler == (unsigned long )((void (*)(struct batadv_priv * , struct batadv_orig_node * , uint8_t , void * , uint16_t ))0)) { return (0); } else { } if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return (0); } else { } (*(tvlv_handler->ogm_handler))(bat_priv, orig_node, 0, tvlv_value, (int )tvlv_value_len); tvlv_handler->flags = (uint8_t )((unsigned int )tvlv_handler->flags | 4U); } else { if ((unsigned long )src == (unsigned long )((uint8_t *)0U)) { return (0); } else { } if ((unsigned long )dst == (unsigned long )((uint8_t *)0U)) { return (0); } else { } if ((unsigned long )tvlv_handler->unicast_handler == (unsigned long )((int (*)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ))0)) { return (0); } else { } tmp = (*(tvlv_handler->unicast_handler))(bat_priv, src, dst, tvlv_value, (int )tvlv_value_len); return (tmp); } return (0); } } int batadv_tvlv_containers_process(struct batadv_priv *bat_priv , bool ogm_source , struct batadv_orig_node *orig_node , uint8_t *src , uint8_t *dst , void *tvlv_value , uint16_t tvlv_value_len ) { struct batadv_tvlv_handler *tvlv_handler ; struct batadv_tvlv_hdr *tvlv_hdr ; uint16_t tvlv_value_cont_len ; uint8_t cifnotfound ; int ret ; __u16 tmp ; int tmp___0 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___1 ; struct hlist_node const *__mptr ; struct batadv_tvlv_handler *tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_tvlv_handler *tmp___4 ; { cifnotfound = 2U; ret = 0; goto ldv_51336; ldv_51335: tvlv_hdr = (struct batadv_tvlv_hdr *)tvlv_value; tmp = __fswab16((int )tvlv_hdr->len); tvlv_value_cont_len = tmp; tvlv_value = (void *)tvlv_hdr + 1U; tvlv_value_len = (unsigned int )tvlv_value_len - 4U; if ((int )tvlv_value_cont_len > (int )tvlv_value_len) { goto ldv_51334; } else { } tvlv_handler = batadv_tvlv_handler_get(bat_priv, (int )tvlv_hdr->type, (int )tvlv_hdr->version); tmp___0 = batadv_tvlv_call_handler(bat_priv, tvlv_handler, (int )ogm_source, orig_node, src, dst, tvlv_value, (int )tvlv_value_cont_len); ret = tmp___0 | ret; if ((unsigned long )tvlv_handler != (unsigned long )((struct batadv_tvlv_handler *)0)) { batadv_tvlv_handler_free_ref(tvlv_handler); } else { } tvlv_value = tvlv_value + (unsigned long )tvlv_value_cont_len; tvlv_value_len = (int )tvlv_value_len - (int )tvlv_value_cont_len; ldv_51336: ; if ((unsigned int )tvlv_value_len > 3U) { goto ldv_51335; } else { } ldv_51334: ; if (! ogm_source) { return (ret); } else { } rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->tvlv.handler_list.first)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___2 = (struct batadv_tvlv_handler *)__mptr; } else { tmp___2 = (struct batadv_tvlv_handler *)0; } tvlv_handler = tmp___2; goto ldv_51358; ldv_51357: ; if (((int )tvlv_handler->flags & 2) != 0 && ((int )tvlv_handler->flags & 4) == 0) { (*(tvlv_handler->ogm_handler))(bat_priv, orig_node, (int )cifnotfound, (void *)0, 0); } else { } tvlv_handler->flags = (unsigned int )tvlv_handler->flags & 251U; _________p1___0 = *((struct hlist_node * volatile *)(& tvlv_handler->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_tvlv_handler *)__mptr___0; } else { tmp___4 = (struct batadv_tvlv_handler *)0; } tvlv_handler = tmp___4; ldv_51358: ; if ((unsigned long )tvlv_handler != (unsigned long )((struct batadv_tvlv_handler *)0)) { goto ldv_51357; } else { } rcu_read_unlock(); return (0); } } void batadv_tvlv_ogm_receive(struct batadv_priv *bat_priv , struct batadv_ogm_packet *batadv_ogm_packet , struct batadv_orig_node *orig_node ) { void *tvlv_value ; uint16_t tvlv_value_len ; __u16 tmp ; { if ((unsigned long )batadv_ogm_packet == (unsigned long )((struct batadv_ogm_packet *)0)) { return; } else { } tmp = __fswab16((int )batadv_ogm_packet->tvlv_len); tvlv_value_len = tmp; if ((unsigned int )tvlv_value_len == 0U) { return; } else { } tvlv_value = (void *)batadv_ogm_packet + 1U; batadv_tvlv_containers_process(bat_priv, 1, orig_node, (uint8_t *)0U, (uint8_t *)0U, tvlv_value, (int )tvlv_value_len); return; } } void batadv_tvlv_handler_register(struct batadv_priv *bat_priv , void (*optr)(struct batadv_priv * , struct batadv_orig_node * , uint8_t , void * , uint16_t ) , int (*uptr)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ) , uint8_t type , uint8_t version , uint8_t flags ) { struct batadv_tvlv_handler *tvlv_handler ; void *tmp ; { tvlv_handler = batadv_tvlv_handler_get(bat_priv, (int )type, (int )version); if ((unsigned long )tvlv_handler != (unsigned long )((struct batadv_tvlv_handler *)0)) { batadv_tvlv_handler_free_ref(tvlv_handler); return; } else { } tmp = kzalloc(56UL, 32U); tvlv_handler = (struct batadv_tvlv_handler *)tmp; if ((unsigned long )tvlv_handler == (unsigned long )((struct batadv_tvlv_handler *)0)) { return; } else { } tvlv_handler->ogm_handler = optr; tvlv_handler->unicast_handler = uptr; tvlv_handler->type = type; tvlv_handler->version = version; tvlv_handler->flags = flags; atomic_set(& tvlv_handler->refcount, 1); INIT_HLIST_NODE(& tvlv_handler->list); spin_lock_bh(& bat_priv->tvlv.handler_list_lock); hlist_add_head_rcu(& tvlv_handler->list, & bat_priv->tvlv.handler_list); spin_unlock_bh(& bat_priv->tvlv.handler_list_lock); return; } } void batadv_tvlv_handler_unregister(struct batadv_priv *bat_priv , uint8_t type , uint8_t version ) { struct batadv_tvlv_handler *tvlv_handler ; { tvlv_handler = batadv_tvlv_handler_get(bat_priv, (int )type, (int )version); if ((unsigned long )tvlv_handler == (unsigned long )((struct batadv_tvlv_handler *)0)) { return; } else { } batadv_tvlv_handler_free_ref(tvlv_handler); spin_lock_bh(& bat_priv->tvlv.handler_list_lock); hlist_del_rcu(& tvlv_handler->list); spin_unlock_bh(& bat_priv->tvlv.handler_list_lock); batadv_tvlv_handler_free_ref(tvlv_handler); return; } } void batadv_tvlv_unicast_send(struct batadv_priv *bat_priv , uint8_t *src , uint8_t *dst , uint8_t type , uint8_t version , void *tvlv_value , uint16_t tvlv_value_len ) { struct batadv_unicast_tvlv_packet *unicast_tvlv_packet ; struct batadv_tvlv_hdr *tvlv_hdr ; struct batadv_orig_node *orig_node ; struct sk_buff *skb ; unsigned char *tvlv_buff ; unsigned int tvlv_len ; ssize_t hdr_len ; bool ret ; __u16 tmp ; __u16 tmp___0 ; size_t __len ; void *__ret ; int tmp___1 ; { skb = (struct sk_buff *)0; hdr_len = 20L; ret = 0; orig_node = batadv_orig_hash_find___3(bat_priv, (void const *)dst); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tvlv_len = (unsigned int )tvlv_value_len + 4U; skb = netdev_alloc_skb_ip_align___1((struct net_device *)0, ((unsigned int )hdr_len + tvlv_len) + 14U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { goto out; } else { } skb->priority = 7U; skb_reserve(skb, 14); tvlv_buff = skb_put(skb, tvlv_len + 20U); unicast_tvlv_packet = (struct batadv_unicast_tvlv_packet *)tvlv_buff; unicast_tvlv_packet->packet_type = 68U; unicast_tvlv_packet->version = 15U; unicast_tvlv_packet->ttl = 50U; unicast_tvlv_packet->reserved = 0U; tmp = __fswab16((int )((__u16 )tvlv_len)); unicast_tvlv_packet->tvlv_len = tmp; unicast_tvlv_packet->align = 0U; ether_addr_copy((u8 *)(& unicast_tvlv_packet->src), (u8 const *)src); ether_addr_copy((u8 *)(& unicast_tvlv_packet->dst), (u8 const *)dst); tvlv_buff = (unsigned char *)unicast_tvlv_packet + 1U; tvlv_hdr = (struct batadv_tvlv_hdr *)tvlv_buff; tvlv_hdr->version = version; tvlv_hdr->type = type; tmp___0 = __fswab16((int )tvlv_value_len); tvlv_hdr->len = tmp___0; tvlv_buff = tvlv_buff + 4UL; __len = (size_t )tvlv_value_len; __ret = __builtin_memcpy((void *)tvlv_buff, (void const *)tvlv_value, __len); tmp___1 = batadv_send_skb_to_orig(skb, orig_node, (struct batadv_hard_iface *)0); if (tmp___1 != 1) { ret = 1; } else { } out: ; if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0) && ! ret) { kfree_skb(skb); } else { } if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return; } } unsigned short batadv_get_vid(struct sk_buff *skb , size_t header_len ) { struct ethhdr *ethhdr ; struct vlan_ethhdr *vhdr ; unsigned short vid ; int tmp ; __u16 tmp___0 ; { ethhdr = (struct ethhdr *)(skb->data + header_len); if ((unsigned int )ethhdr->h_proto != 129U) { return (0U); } else { } tmp = pskb_may_pull(skb, (unsigned int )header_len + 18U); if (tmp == 0) { return (0U); } else { } vhdr = (struct vlan_ethhdr *)(skb->data + header_len); tmp___0 = __fswab16((int )vhdr->h_vlan_TCI); vid = (unsigned int )tmp___0 & 4095U; vid = (unsigned int )vid | 32768U; return (vid); } } bool batadv_vlan_ap_isola_get(struct batadv_priv *bat_priv , unsigned short vid ) { bool ap_isolation_enabled ; struct batadv_softif_vlan *vlan ; int tmp ; { ap_isolation_enabled = 0; vlan = batadv_softif_vlan_get(bat_priv, (int )vid); if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { tmp = atomic_read((atomic_t const *)(& vlan->ap_isolation)); ap_isolation_enabled = tmp != 0; batadv_softif_vlan_free_ref(vlan); } else { } return (ap_isolation_enabled); } } static int batadv_param_set_ra(char const *val , struct kernel_param const *kp ) { struct batadv_algo_ops *bat_algo_ops ; char *algo_name ; size_t name_len ; size_t tmp ; int tmp___0 ; { algo_name = (char *)val; tmp = strlen((char const *)algo_name); name_len = tmp; if (name_len != 0UL && (int )((signed char )*(algo_name + (name_len + 0xffffffffffffffffUL))) == 10) { *(algo_name + (name_len + 0xffffffffffffffffUL)) = 0; } else { } bat_algo_ops = batadv_algo_get(algo_name); if ((unsigned long )bat_algo_ops == (unsigned long )((struct batadv_algo_ops *)0)) { printk("\vbatman_adv: Routing algorithm \'%s\' is not supported\n", algo_name); return (-22); } else { } tmp___0 = param_set_copystring((char const *)algo_name, kp); return (tmp___0); } } int ldv_retval_11 ; extern void ldv_initialize(void) ; extern void ldv_check_final_state(void) ; void ldv_initialize_kernel_param_ops_22(void) { void *tmp ; { tmp = ldv_zalloc(32UL); batadv_param_ops_ra_group0 = (struct kernel_param *)tmp; return; } } void ldv_main_exported_21(void) ; void ldv_main_exported_19(void) ; void ldv_main_exported_20(void) ; void ldv_main_exported_11(void) ; void ldv_main_exported_7(void) ; void ldv_main_exported_17(void) ; void ldv_main_exported_2(void) ; void ldv_main_exported_1(void) ; void ldv_main_exported_18(void) ; void ldv_main_exported_16(void) ; void ldv_main_exported_13(void) ; void ldv_main_exported_6(void) ; void ldv_main_exported_3(void) ; void ldv_main_exported_9(void) ; void ldv_main_exported_12(void) ; void ldv_main_exported_14(void) ; void ldv_main_exported_15(void) ; void ldv_main_exported_8(void) ; void ldv_main_exported_4(void) ; void ldv_main_exported_10(void) ; void ldv_main_exported_5(void) ; int main(void) { char *ldvarg91 ; void *tmp ; char *ldvarg92 ; void *tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { tmp = ldv_zalloc(1UL); ldvarg91 = (char *)tmp; tmp___0 = ldv_zalloc(1UL); ldvarg92 = (char *)tmp___0; ldv_initialize(); ldv_state_variable_33 = 0; ldv_state_variable_32 = 0; ldv_state_variable_21 = 0; ldv_state_variable_7 = 0; ldv_state_variable_26 = 0; ldv_state_variable_17 = 0; ldv_state_variable_2 = 0; ldv_state_variable_1 = 0; ldv_state_variable_18 = 0; ldv_state_variable_30 = 0; ldv_state_variable_16 = 0; ldv_state_variable_27 = 0; ldv_state_variable_25 = 0; ldv_state_variable_28 = 0; ldv_state_variable_20 = 0; ldv_state_variable_14 = 0; ldv_state_variable_24 = 0; ldv_state_variable_10 = 0; ldv_state_variable_31 = 0; ldv_state_variable_35 = 0; ldv_state_variable_11 = 0; ldv_state_variable_22 = 0; ref_cnt = 0; ldv_state_variable_0 = 1; ldv_state_variable_13 = 0; ldv_state_variable_23 = 0; ldv_state_variable_29 = 0; ldv_state_variable_6 = 0; ldv_state_variable_36 = 0; ldv_state_variable_3 = 0; ldv_state_variable_9 = 0; ldv_state_variable_12 = 0; ldv_state_variable_15 = 0; ldv_state_variable_8 = 0; ldv_state_variable_4 = 0; ldv_state_variable_34 = 0; ldv_state_variable_19 = 0; ldv_state_variable_5 = 0; ldv_51596: tmp___1 = __VERIFIER_nondet_int(); switch (tmp___1) { case 0: ; if (ldv_state_variable_33 != 0) { ldv_main_exported_33(); } else { } goto ldv_51549; case 1: ; if (ldv_state_variable_32 != 0) { ldv_main_exported_32(); } else { } goto ldv_51549; case 2: ; if (ldv_state_variable_21 != 0) { ldv_main_exported_21(); } else { } goto ldv_51549; case 3: ; if (ldv_state_variable_7 != 0) { ldv_main_exported_7(); } else { } goto ldv_51549; case 4: ; if (ldv_state_variable_26 != 0) { ldv_main_exported_26(); } else { } goto ldv_51549; case 5: ; if (ldv_state_variable_17 != 0) { ldv_main_exported_17(); } else { } goto ldv_51549; case 6: ; if (ldv_state_variable_2 != 0) { ldv_main_exported_2(); } else { } goto ldv_51549; case 7: ; if (ldv_state_variable_1 != 0) { ldv_main_exported_1(); } else { } goto ldv_51549; case 8: ; if (ldv_state_variable_18 != 0) { ldv_main_exported_18(); } else { } goto ldv_51549; case 9: ; if (ldv_state_variable_30 != 0) { ldv_main_exported_30(); } else { } goto ldv_51549; case 10: ; if (ldv_state_variable_16 != 0) { ldv_main_exported_16(); } else { } goto ldv_51549; case 11: ; if (ldv_state_variable_27 != 0) { ldv_main_exported_27(); } else { } goto ldv_51549; case 12: ; if (ldv_state_variable_25 != 0) { ldv_main_exported_25(); } else { } goto ldv_51549; case 13: ; if (ldv_state_variable_28 != 0) { ldv_main_exported_28(); } else { } goto ldv_51549; case 14: ; if (ldv_state_variable_20 != 0) { ldv_main_exported_20(); } else { } goto ldv_51549; case 15: ; if (ldv_state_variable_14 != 0) { ldv_main_exported_14(); } else { } goto ldv_51549; case 16: ; if (ldv_state_variable_24 != 0) { ldv_main_exported_24(); } else { } goto ldv_51549; case 17: ; if (ldv_state_variable_10 != 0) { ldv_main_exported_10(); } else { } goto ldv_51549; case 18: ; if (ldv_state_variable_31 != 0) { ldv_main_exported_31(); } else { } goto ldv_51549; case 19: ; if (ldv_state_variable_35 != 0) { ldv_main_exported_35(); } else { } goto ldv_51549; case 20: ; if (ldv_state_variable_11 != 0) { ldv_main_exported_11(); } else { } goto ldv_51549; case 21: ; if (ldv_state_variable_22 != 0) { tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_22 == 1) { batadv_param_set_ra((char const *)ldvarg92, (struct kernel_param const *)batadv_param_ops_ra_group0); ldv_state_variable_22 = 1; } else { } goto ldv_51572; case 1: ; if (ldv_state_variable_22 == 1) { param_get_string(ldvarg91, (struct kernel_param const *)batadv_param_ops_ra_group0); ldv_state_variable_22 = 1; } else { } goto ldv_51572; default: ldv_stop(); } ldv_51572: ; } else { } goto ldv_51549; case 22: ; if (ldv_state_variable_0 != 0) { tmp___3 = __VERIFIER_nondet_int(); switch (tmp___3) { case 0: ; if (ldv_state_variable_0 == 2 && ref_cnt == 0) { batadv_exit(); ldv_state_variable_0 = 3; goto ldv_final; } else { } goto ldv_51578; case 1: ; if (ldv_state_variable_0 == 1) { ldv_retval_11 = batadv_init(); if (ldv_retval_11 != 0) { ldv_state_variable_0 = 3; goto ldv_final; } else { } if (ldv_retval_11 == 0) { ldv_state_variable_0 = 2; ldv_state_variable_5 = 1; ldv_initialize_batadv_attribute_5(); ldv_state_variable_19 = 1; ldv_initialize_rtnl_link_ops_19(); ldv_state_variable_34 = 1; ldv_initialize_batadv_debuginfo_34(); ldv_state_variable_4 = 1; ldv_initialize_batadv_attribute_4(); ldv_state_variable_8 = 1; ldv_initialize_batadv_attribute_8(); ldv_state_variable_15 = 1; ldv_initialize_batadv_attribute_15(); ldv_state_variable_12 = 1; ldv_initialize_batadv_attribute_12(); ldv_state_variable_9 = 1; ldv_initialize_batadv_attribute_9(); ldv_state_variable_3 = 1; ldv_initialize_batadv_attribute_3(); ldv_state_variable_36 = 1; ldv_initialize_batadv_algo_ops_36(); ldv_state_variable_6 = 1; ldv_initialize_batadv_attribute_6(); ldv_state_variable_29 = 1; ldv_initialize_batadv_debuginfo_29(); ldv_state_variable_23 = 1; ldv_file_operations_23(); ldv_state_variable_13 = 1; ldv_state_variable_22 = 1; ldv_initialize_kernel_param_ops_22(); ldv_state_variable_11 = 1; ldv_initialize_batadv_attribute_11(); ldv_state_variable_35 = 1; ldv_file_operations_35(); ldv_state_variable_31 = 1; ldv_initialize_batadv_debuginfo_31(); ldv_state_variable_10 = 1; ldv_initialize_batadv_attribute_10(); ldv_state_variable_24 = 1; ldv_state_variable_14 = 1; ldv_initialize_batadv_attribute_14(); ldv_state_variable_20 = 1; ldv_net_device_ops_20(); ldv_state_variable_28 = 1; ldv_initialize_batadv_debuginfo_28(); ldv_state_variable_25 = 1; ldv_initialize_batadv_debuginfo_25(); ldv_state_variable_27 = 1; ldv_initialize_batadv_debuginfo_27(); ldv_state_variable_16 = 1; ldv_initialize_batadv_attribute_16(); ldv_state_variable_30 = 1; ldv_initialize_batadv_debuginfo_30(); ldv_state_variable_18 = 1; ldv_initialize_batadv_attribute_18(); ldv_state_variable_1 = 1; ldv_state_variable_2 = 1; ldv_initialize_batadv_attribute_2(); ldv_state_variable_17 = 1; ldv_initialize_batadv_attribute_17(); ldv_state_variable_26 = 1; ldv_initialize_batadv_debuginfo_26(); ldv_state_variable_7 = 1; ldv_initialize_batadv_attribute_7(); ldv_state_variable_21 = 1; ldv_initialize_ethtool_ops_21(); ldv_state_variable_32 = 1; ldv_initialize_batadv_debuginfo_32(); ldv_state_variable_33 = 1; ldv_initialize_batadv_debuginfo_33(); } else { } } else { } goto ldv_51578; default: ldv_stop(); } ldv_51578: ; } else { } goto ldv_51549; case 23: ; if (ldv_state_variable_13 != 0) { ldv_main_exported_13(); } else { } goto ldv_51549; case 24: ; if (ldv_state_variable_23 != 0) { ldv_main_exported_23(); } else { } goto ldv_51549; case 25: ; if (ldv_state_variable_29 != 0) { ldv_main_exported_29(); } else { } goto ldv_51549; case 26: ; if (ldv_state_variable_6 != 0) { ldv_main_exported_6(); } else { } goto ldv_51549; case 27: ; if (ldv_state_variable_36 != 0) { ldv_main_exported_36(); } else { } goto ldv_51549; case 28: ; if (ldv_state_variable_3 != 0) { ldv_main_exported_3(); } else { } goto ldv_51549; case 29: ; if (ldv_state_variable_9 != 0) { ldv_main_exported_9(); } else { } goto ldv_51549; case 30: ; if (ldv_state_variable_12 != 0) { ldv_main_exported_12(); } else { } goto ldv_51549; case 31: ; if (ldv_state_variable_15 != 0) { ldv_main_exported_15(); } else { } goto ldv_51549; case 32: ; if (ldv_state_variable_8 != 0) { ldv_main_exported_8(); } else { } goto ldv_51549; case 33: ; if (ldv_state_variable_4 != 0) { ldv_main_exported_4(); } else { } goto ldv_51549; case 34: ; if (ldv_state_variable_34 != 0) { ldv_main_exported_34(); } else { } goto ldv_51549; case 35: ; if (ldv_state_variable_19 != 0) { ldv_main_exported_19(); } else { } goto ldv_51549; case 36: ; if (ldv_state_variable_5 != 0) { ldv_main_exported_5(); } else { } goto ldv_51549; default: ldv_stop(); } ldv_51549: ; goto ldv_51596; ldv_final: ldv_check_final_state(); return 0; } } void *ldv_kmem_cache_alloc_508(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_514(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } __inline static struct sk_buff *skb_share_check(struct sk_buff *skb , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = ldv_skb_share_check_515(skb, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_516(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_518(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_519(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_520(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_521(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_522(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_523(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_524(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_525(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_552(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_569(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; extern struct dentry *debugfs_create_u8(char const * , umode_t , struct dentry * , u8 * ) ; extern struct dentry *debugfs_create_u32(char const * , umode_t , struct dentry * , u32 * ) ; extern int net_ratelimit(void) ; struct sk_buff *ldv_skb_clone_560(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_568(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_570(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_562(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_558(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_566(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_567(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; __inline static int skb_cloned(struct sk_buff const *skb ) { unsigned char *tmp ; int tmp___0 ; int tmp___1 ; { if ((unsigned int )*((unsigned char *)skb + 124UL) != 0U) { tmp = skb_end_pointer(skb); tmp___0 = atomic_read((atomic_t const *)(& ((struct skb_shared_info *)tmp)->dataref)); if ((tmp___0 & 65535) != 1) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } __inline static void skb_reset_tail_pointer(struct sk_buff *skb ) { { skb->tail = (sk_buff_data_t )((long )skb->data) - (sk_buff_data_t )((long )skb->head); return; } } __inline static void skb_set_tail_pointer(struct sk_buff *skb , int const offset ) { { skb_reset_tail_pointer(skb); skb->tail = skb->tail + (sk_buff_data_t )offset; return; } } __inline static unsigned char *skb_network_header(struct sk_buff const *skb ) { { return ((unsigned char *)skb->head + (unsigned long )skb->network_header); } } extern int ___pskb_trim(struct sk_buff * , unsigned int ) ; __inline static void __skb_trim(struct sk_buff *skb , unsigned int len ) { int __ret_warn_on ; long tmp ; bool tmp___0 ; long tmp___1 ; { tmp___0 = skb_is_nonlinear((struct sk_buff const *)skb); tmp___1 = ldv__builtin_expect((long )tmp___0, 0L); if (tmp___1 != 0L) { __ret_warn_on = 1; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/skbuff.h", 1922); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); return; } else { } skb->len = len; skb_set_tail_pointer(skb, (int const )len); return; } } __inline static int __pskb_trim(struct sk_buff *skb , unsigned int len ) { int tmp ; { if (skb->data_len != 0U) { tmp = ___pskb_trim(skb, len); return (tmp); } else { } __skb_trim(skb, len); return (0); } } struct sk_buff *ldv___netdev_alloc_skb_563(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_564(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_565(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static int __skb_cow___1(struct sk_buff *skb , unsigned int headroom , int cloned ) { int delta ; unsigned int tmp ; unsigned int tmp___0 ; int _max1 ; int _max2 ; int _max1___0 ; int _max2___0 ; int tmp___1 ; { delta = 0; tmp___0 = skb_headroom((struct sk_buff const *)skb); if (tmp___0 < headroom) { tmp = skb_headroom((struct sk_buff const *)skb); delta = (int )(headroom - tmp); } else { } if (delta != 0 || cloned != 0) { _max1 = 32; _max2 = 64; _max1___0 = 32; _max2___0 = 64; tmp___1 = ldv_pskb_expand_head_566(skb, (((_max1 > _max2 ? _max1 : _max2) + -1) + delta) & - (_max1___0 > _max2___0 ? _max1___0 : _max2___0), 0, 32U); return (tmp___1); } else { } return (0); } } __inline static int skb_cow(struct sk_buff *skb , unsigned int headroom ) { int tmp ; int tmp___0 ; { tmp = skb_cloned((struct sk_buff const *)skb); tmp___0 = __skb_cow___1(skb, headroom, tmp); return (tmp___0); } } __inline static int pskb_trim_rcsum(struct sk_buff *skb , unsigned int len ) { long tmp ; int tmp___0 ; { tmp = ldv__builtin_expect(skb->len <= len, 1L); if (tmp != 0L) { return (0); } else { } if ((unsigned int )*((unsigned char *)skb + 124UL) == 8U) { skb->ip_summed = 0U; } else { } tmp___0 = __pskb_trim(skb, len); return (tmp___0); } } __inline static void batadv_add_counter___3(struct batadv_priv *bat_priv , size_t idx , size_t count ) { void const *__vpp_verify ; int pao_ID__ ; int pao_ID_____0 ; int pao_ID_____1 ; int pao_ID_____2 ; { __vpp_verify = (void const *)0; switch (8UL) { case 1UL: pao_ID__ = 0; switch (8UL) { case 1UL: ; if (pao_ID__ == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49367; case 2UL: ; if (pao_ID__ == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49367; case 4UL: ; if (pao_ID__ == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49367; case 8UL: ; if (pao_ID__ == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID__ == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49367; default: __bad_percpu_size(); } ldv_49367: ; goto ldv_49372; case 2UL: pao_ID_____0 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____0 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49378; case 2UL: ; if (pao_ID_____0 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49378; case 4UL: ; if (pao_ID_____0 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49378; case 8UL: ; if (pao_ID_____0 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____0 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49378; default: __bad_percpu_size(); } ldv_49378: ; goto ldv_49372; case 4UL: pao_ID_____1 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____1 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49388; case 2UL: ; if (pao_ID_____1 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49388; case 4UL: ; if (pao_ID_____1 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49388; case 8UL: ; if (pao_ID_____1 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____1 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49388; default: __bad_percpu_size(); } ldv_49388: ; goto ldv_49372; case 8UL: pao_ID_____2 = 0; switch (8UL) { case 1UL: ; if (pao_ID_____2 == 1) { __asm__ ("incb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decb %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addb %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "qi" ((unsigned long long )count)); } goto ldv_49398; case 2UL: ; if (pao_ID_____2 == 1) { __asm__ ("incw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decw %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addw %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49398; case 4UL: ; if (pao_ID_____2 == 1) { __asm__ ("incl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decl %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addl %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "ri" ((unsigned long long )count)); } goto ldv_49398; case 8UL: ; if (pao_ID_____2 == 1) { __asm__ ("incq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else if (pao_ID_____2 == -1) { __asm__ ("decq %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx))); } else { __asm__ ("addq %1, %%gs:%P0": "+m" (*(bat_priv->bat_counters + idx)): "re" ((unsigned long long )count)); } goto ldv_49398; default: __bad_percpu_size(); } ldv_49398: ; goto ldv_49372; default: __bad_size_call_parameter(); goto ldv_49372; } ldv_49372: ; return; } } __inline static uint32_t batadv_hash_bytes___1(uint32_t hash , void const *data , uint32_t size ) { unsigned char const *key ; int i ; { key = (unsigned char const *)data; i = 0; goto ldv_49524; ldv_49523: hash = (uint32_t )*(key + (unsigned long )i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1; ldv_49524: ; if ((uint32_t )i < size) { goto ldv_49523; } else { } return (hash); } } __inline static int batadv_hash_add___2(struct batadv_hashtable *hash , int (*compare)(struct hlist_node const * , void const * ) , uint32_t (*choose)(void const * , uint32_t ) , void const *data , struct hlist_node *data_node ) { uint32_t index ; int ret ; struct hlist_head *head ; struct hlist_node *node ; spinlock_t *list_lock ; int tmp ; { ret = -1; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { goto out; } else { } index = (*choose)(data, hash->size); head = hash->table + (unsigned long )index; list_lock = hash->list_locks + (unsigned long )index; spin_lock_bh(list_lock); node = head->first; goto ldv_49542; ldv_49541: tmp = (*compare)((struct hlist_node const *)node, data); if (tmp == 0) { goto ldv_49539; } else { } ret = 1; goto unlock; ldv_49539: node = node->next; ldv_49542: ; if ((unsigned long )node != (unsigned long )((struct hlist_node *)0)) { goto ldv_49541; } else { } hlist_add_head_rcu(data_node, head); ret = 0; unlock: spin_unlock_bh(list_lock); out: ; return (ret); } } void batadv_nc_status_update(struct net_device *net_dev ) ; void batadv_nc_purge_orig(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , bool (*to_purge)(struct batadv_priv * , struct batadv_nc_node * ) ) ; void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv ) ; void batadv_nc_init_orig(struct batadv_orig_node *orig_node ) ; bool batadv_nc_skb_forward(struct sk_buff *skb , struct batadv_neigh_node *neigh_node ) ; void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv , struct sk_buff *skb ) ; void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv , struct sk_buff *skb ) ; struct batadv_orig_ifinfo *batadv_orig_ifinfo_get(struct batadv_orig_node *orig_node , struct batadv_hard_iface *if_outgoing ) ; __inline static uint32_t batadv_choose_orig___5(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49724; ldv_49723: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49724: ; if (i <= 5UL) { goto ldv_49723; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find___4(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig___5(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_49758; ldv_49757: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_49755; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49755; } else { } orig_node_tmp = orig_node; goto ldv_49756; ldv_49755: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_49758: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49757; } else { } ldv_49756: rcu_read_unlock(); return (orig_node_tmp); } } static struct lock_class_key batadv_nc_coding_hash_lock_class_key ; static struct lock_class_key batadv_nc_decoding_hash_lock_class_key ; static void batadv_nc_worker(struct work_struct *work ) ; static int batadv_nc_recv_coded_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; int batadv_nc_init(void) { int ret ; { ret = batadv_recv_handler_register(2, & batadv_nc_recv_coded_packet); return (ret); } } static void batadv_nc_start_timer(struct batadv_priv *bat_priv ) { unsigned long tmp ; { tmp = msecs_to_jiffies(10U); queue_delayed_work(batadv_event_workqueue, & bat_priv->nc.work, tmp); return; } } static void batadv_nc_tvlv_container_update(struct batadv_priv *bat_priv ) { char nc_mode ; int tmp ; { tmp = atomic_read((atomic_t const *)(& bat_priv->network_coding)); nc_mode = (char )tmp; switch ((int )nc_mode) { case 0: batadv_tvlv_container_unregister(bat_priv, 3, 1); goto ldv_49864; case 1: batadv_tvlv_container_register(bat_priv, 3, 1, (void *)0, 0); goto ldv_49864; } ldv_49864: ; return; } } void batadv_nc_status_update(struct net_device *net_dev ) { struct batadv_priv *bat_priv ; void *tmp ; { tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; batadv_nc_tvlv_container_update(bat_priv); return; } } static void batadv_nc_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t flags , void *tvlv_value , uint16_t tvlv_value_len ) { { if (((int )flags & 2) != 0) { orig->capabilities = (unsigned int )orig->capabilities & 253U; } else { orig->capabilities = (uint8_t )((unsigned int )orig->capabilities | 2U); } return; } } int batadv_nc_mesh_init(struct batadv_priv *bat_priv ) { struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___0 ; { bat_priv->nc.timestamp_fwd_flush = jiffies; bat_priv->nc.timestamp_sniffed_purge = jiffies; if ((unsigned long )bat_priv->nc.coding_hash != (unsigned long )((struct batadv_hashtable *)0) || (unsigned long )bat_priv->nc.decoding_hash != (unsigned long )((struct batadv_hashtable *)0)) { return (0); } else { } bat_priv->nc.coding_hash = batadv_hash_new(128U); if ((unsigned long )bat_priv->nc.coding_hash == (unsigned long )((struct batadv_hashtable *)0)) { goto err; } else { } batadv_hash_set_lock_class(bat_priv->nc.coding_hash, & batadv_nc_coding_hash_lock_class_key); bat_priv->nc.decoding_hash = batadv_hash_new(128U); if ((unsigned long )bat_priv->nc.decoding_hash == (unsigned long )((struct batadv_hashtable *)0)) { goto err; } else { } batadv_hash_set_lock_class(bat_priv->nc.coding_hash, & batadv_nc_decoding_hash_lock_class_key); __init_work(& bat_priv->nc.work.work, 0); __constr_expr_0.counter = 137438953408L; bat_priv->nc.work.work.data = __constr_expr_0; lockdep_init_map(& bat_priv->nc.work.work.lockdep_map, "(&(&bat_priv->nc.work)->work)", & __key, 0); INIT_LIST_HEAD(& bat_priv->nc.work.work.entry); bat_priv->nc.work.work.func = & batadv_nc_worker; init_timer_key(& bat_priv->nc.work.timer, 2U, "(&(&bat_priv->nc.work)->timer)", & __key___0); bat_priv->nc.work.timer.function = & delayed_work_timer_fn; bat_priv->nc.work.timer.data = (unsigned long )(& bat_priv->nc.work); batadv_nc_start_timer(bat_priv); batadv_tvlv_handler_register(bat_priv, & batadv_nc_tvlv_ogm_handler_v1, (int (*)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ))0, 3, 1, 2); batadv_nc_tvlv_container_update(bat_priv); return (0); err: ; return (-12); } } void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv ) { { atomic_set(& bat_priv->network_coding, 1); bat_priv->nc.min_tq = 200U; bat_priv->nc.max_fwd_delay = 10U; bat_priv->nc.max_buffer_time = 200U; return; } } void batadv_nc_init_orig(struct batadv_orig_node *orig_node ) { struct lock_class_key __key ; struct lock_class_key __key___0 ; { INIT_LIST_HEAD(& orig_node->in_coding_list); INIT_LIST_HEAD(& orig_node->out_coding_list); spinlock_check(& orig_node->in_coding_list_lock); __raw_spin_lock_init(& orig_node->in_coding_list_lock.ldv_6347.rlock, "&(&orig_node->in_coding_list_lock)->rlock", & __key); spinlock_check(& orig_node->out_coding_list_lock); __raw_spin_lock_init(& orig_node->out_coding_list_lock.ldv_6347.rlock, "&(&orig_node->out_coding_list_lock)->rlock", & __key___0); return; } } static void batadv_nc_node_free_rcu(struct callback_head *rcu ) { struct batadv_nc_node *nc_node ; struct callback_head const *__mptr ; { __mptr = (struct callback_head const *)rcu; nc_node = (struct batadv_nc_node *)__mptr + 0xffffffffffffffe0UL; batadv_orig_node_free_ref(nc_node->orig_node); kfree((void const *)nc_node); return; } } static void batadv_nc_node_free_ref(struct batadv_nc_node *nc_node ) { int tmp ; { tmp = atomic_dec_and_test(& nc_node->refcount); if (tmp != 0) { call_rcu_sched(& nc_node->rcu, & batadv_nc_node_free_rcu); } else { } return; } } static void batadv_nc_path_free_ref(struct batadv_nc_path *nc_path ) { int tmp ; { tmp = atomic_dec_and_test(& nc_path->refcount); if (tmp != 0) { kfree_call_rcu(& nc_path->rcu, (void (*)(struct callback_head * ))16); } else { } return; } } static void batadv_nc_packet_free(struct batadv_nc_packet *nc_packet ) { { if ((unsigned long )nc_packet->skb != (unsigned long )((struct sk_buff *)0)) { kfree_skb(nc_packet->skb); } else { } batadv_nc_path_free_ref(nc_packet->nc_path); kfree((void const *)nc_packet); return; } } static bool batadv_nc_to_purge_nc_node(struct batadv_priv *bat_priv , struct batadv_nc_node *nc_node ) { int tmp ; bool tmp___0 ; { tmp = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp != 1) { return (1); } else { } tmp___0 = batadv_has_timed_out(nc_node->last_seen, 10000U); return (tmp___0); } } static bool batadv_nc_to_purge_nc_path_coding(struct batadv_priv *bat_priv , struct batadv_nc_path *nc_path ) { int tmp ; bool tmp___0 ; { tmp = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp != 1) { return (1); } else { } tmp___0 = batadv_has_timed_out(nc_path->last_valid, bat_priv->nc.max_fwd_delay * 10U); return (tmp___0); } } static bool batadv_nc_to_purge_nc_path_decoding(struct batadv_priv *bat_priv , struct batadv_nc_path *nc_path ) { int tmp ; bool tmp___0 ; { tmp = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp != 1) { return (1); } else { } tmp___0 = batadv_has_timed_out(nc_path->last_valid, bat_priv->nc.max_buffer_time * 10U); return (tmp___0); } } static void batadv_nc_purge_orig_nc_nodes(struct batadv_priv *bat_priv , struct list_head *list , spinlock_t *lock , bool (*to_purge)(struct batadv_priv * , struct batadv_nc_node * ) ) { struct batadv_nc_node *nc_node ; struct batadv_nc_node *nc_node_tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; bool tmp ; int tmp___0 ; int tmp___1 ; struct list_head const *__mptr___1 ; { spin_lock_bh(lock); __mptr = (struct list_head const *)list->next; nc_node = (struct batadv_nc_node *)__mptr; __mptr___0 = (struct list_head const *)nc_node->list.next; nc_node_tmp = (struct batadv_nc_node *)__mptr___0; goto ldv_49938; ldv_49937: ; if ((unsigned long )to_purge != (unsigned long )((bool (*)(struct batadv_priv * , struct batadv_nc_node * ))0)) { tmp = (*to_purge)(bat_priv, nc_node); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto ldv_49936; } else { } } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 32) != 0) { batadv_debug_log(bat_priv, "Removing nc_node %pM -> %pM\n", (uint8_t *)(& nc_node->addr), (uint8_t *)(& (nc_node->orig_node)->orig)); } else { } list_del_rcu(& nc_node->list); batadv_nc_node_free_ref(nc_node); ldv_49936: nc_node = nc_node_tmp; __mptr___1 = (struct list_head const *)nc_node_tmp->list.next; nc_node_tmp = (struct batadv_nc_node *)__mptr___1; ldv_49938: ; if ((unsigned long )(& nc_node->list) != (unsigned long )list) { goto ldv_49937; } else { } spin_unlock_bh(lock); return; } } void batadv_nc_purge_orig(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , bool (*to_purge)(struct batadv_priv * , struct batadv_nc_node * ) ) { { batadv_nc_purge_orig_nc_nodes(bat_priv, & orig_node->in_coding_list, & orig_node->in_coding_list_lock, to_purge); batadv_nc_purge_orig_nc_nodes(bat_priv, & orig_node->out_coding_list, & orig_node->out_coding_list_lock, to_purge); return; } } static void batadv_nc_purge_orig_hash(struct batadv_priv *bat_priv ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___1 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___2 ; { hash = bat_priv->orig_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0U; goto ldv_49978; ldv_49977: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___0 = (struct batadv_orig_node *)0; } orig_node = tmp___0; goto ldv_49975; ldv_49974: batadv_nc_purge_orig(bat_priv, orig_node, & batadv_nc_to_purge_nc_node); _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___2 = (struct batadv_orig_node *)0; } orig_node = tmp___2; ldv_49975: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49974; } else { } rcu_read_unlock(); i = i + 1U; ldv_49978: ; if (hash->size > i) { goto ldv_49977; } else { } return; } } static void batadv_nc_purge_paths(struct batadv_priv *bat_priv , struct batadv_hashtable *hash , bool (*to_purge)(struct batadv_priv * , struct batadv_nc_path * ) ) { struct hlist_head *head ; struct hlist_node *node_tmp ; struct batadv_nc_path *nc_path ; spinlock_t *lock ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_nc_path *tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_nc_path *tmp___6 ; { i = 0U; goto ldv_50006; ldv_50005: head = hash->table + (unsigned long )i; lock = hash->list_locks + (unsigned long )i; spin_lock_bh(lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_nc_path *)__mptr; } else { tmp = (struct batadv_nc_path *)0; } nc_path = tmp; goto ldv_50003; ldv_50002: ; if ((unsigned long )to_purge != (unsigned long )((bool (*)(struct batadv_priv * , struct batadv_nc_path * ))0)) { tmp___0 = (*to_purge)(bat_priv, nc_path); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_50001; } else { } } else { } tmp___3 = list_empty((struct list_head const *)(& nc_path->packet_list)); tmp___4 = ldv__builtin_expect(tmp___3 != 0, 0L); if (tmp___4 == 0L) { tmp___2 = net_ratelimit(); if (tmp___2 != 0) { printk("\fSkipping free of non-empty nc_path (%pM -> %pM)!\n", (uint8_t *)(& nc_path->prev_hop), (uint8_t *)(& nc_path->next_hop)); } else { } goto ldv_50001; } else { } tmp___5 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___5 & 32) != 0) { batadv_debug_log(bat_priv, "Remove nc_path %pM -> %pM\n", (uint8_t *)(& nc_path->prev_hop), (uint8_t *)(& nc_path->next_hop)); } else { } hlist_del_rcu(& nc_path->hash_entry); batadv_nc_path_free_ref(nc_path); ldv_50001: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___6 = (struct batadv_nc_path *)__mptr___0; } else { tmp___6 = (struct batadv_nc_path *)0; } nc_path = tmp___6; ldv_50003: ; if ((unsigned long )nc_path != (unsigned long )((struct batadv_nc_path *)0)) { node_tmp = nc_path->hash_entry.next; goto ldv_50002; } else { } spin_unlock_bh(lock); i = i + 1U; ldv_50006: ; if (hash->size > i) { goto ldv_50005; } else { } return; } } static void batadv_nc_hash_key_gen(struct batadv_nc_path *key , char const *src , char const *dst ) { size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; { __len = 6UL; if (__len > 63UL) { __ret = __memcpy((void *)(& key->prev_hop), (void const *)src, __len); } else { __ret = __builtin_memcpy((void *)(& key->prev_hop), (void const *)src, __len); } __len___0 = 6UL; if (__len___0 > 63UL) { __ret___0 = __memcpy((void *)(& key->next_hop), (void const *)dst, __len___0); } else { __ret___0 = __builtin_memcpy((void *)(& key->next_hop), (void const *)dst, __len___0); } return; } } static uint32_t batadv_nc_hash_choose(void const *data , uint32_t size ) { struct batadv_nc_path const *nc_path ; uint32_t hash ; { nc_path = (struct batadv_nc_path const *)data; hash = 0U; hash = batadv_hash_bytes___1(hash, (void const *)(& nc_path->prev_hop), 6U); hash = batadv_hash_bytes___1(hash, (void const *)(& nc_path->next_hop), 6U); hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } static int batadv_nc_hash_compare(struct hlist_node const *node , void const *data2 ) { struct batadv_nc_path const *nc_path1 ; struct batadv_nc_path const *nc_path2 ; struct hlist_node const *__mptr ; int tmp ; int tmp___0 ; { __mptr = node; nc_path1 = (struct batadv_nc_path const *)((struct batadv_nc_path *)__mptr); nc_path2 = (struct batadv_nc_path const *)data2; tmp = memcmp((void const *)(& nc_path1->prev_hop), (void const *)(& nc_path2->prev_hop), 6UL); if (tmp != 0) { return (0); } else { } tmp___0 = memcmp((void const *)(& nc_path1->next_hop), (void const *)(& nc_path2->next_hop), 6UL); if (tmp___0 != 0) { return (0); } else { } return (1); } } static struct batadv_nc_path *batadv_nc_hash_find(struct batadv_hashtable *hash , void *data ) { struct hlist_head *head ; struct batadv_nc_path *nc_path ; struct batadv_nc_path *nc_path_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_nc_path *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_nc_path *tmp___5 ; { nc_path_tmp = (struct batadv_nc_path *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_nc_path *)0); } else { } tmp = batadv_nc_hash_choose((void const *)data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_nc_path *)__mptr; } else { tmp___1 = (struct batadv_nc_path *)0; } nc_path = tmp___1; goto ldv_50064; ldv_50063: tmp___2 = batadv_nc_hash_compare((struct hlist_node const *)(& nc_path->hash_entry), (void const *)data); if (tmp___2 == 0) { goto ldv_50061; } else { } tmp___3 = atomic_add_unless(& nc_path->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_50061; } else { } nc_path_tmp = nc_path; goto ldv_50062; ldv_50061: _________p1___0 = *((struct hlist_node * volatile *)(& nc_path->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_nc_path *)__mptr___0; } else { tmp___5 = (struct batadv_nc_path *)0; } nc_path = tmp___5; ldv_50064: ; if ((unsigned long )nc_path != (unsigned long )((struct batadv_nc_path *)0)) { goto ldv_50063; } else { } ldv_50062: rcu_read_unlock(); return (nc_path_tmp); } } static void batadv_nc_send_packet(struct batadv_nc_packet *nc_packet ) { { batadv_send_skb_packet(nc_packet->skb, (nc_packet->neigh_node)->if_incoming, (uint8_t const *)(& (nc_packet->nc_path)->next_hop)); nc_packet->skb = (struct sk_buff *)0; batadv_nc_packet_free(nc_packet); return; } } static bool batadv_nc_sniffed_purge(struct batadv_priv *bat_priv , struct batadv_nc_path *nc_path , struct batadv_nc_packet *nc_packet ) { unsigned long timeout ; bool res ; int tmp ; bool tmp___0 ; int tmp___1 ; { timeout = (unsigned long )bat_priv->nc.max_buffer_time; res = 0; tmp = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp == 1) { tmp___0 = batadv_has_timed_out(nc_packet->timestamp, (unsigned int )timeout); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto out; } else { } } else { } list_del(& nc_packet->list); batadv_nc_packet_free(nc_packet); res = 1; out: ; return (res); } } static bool batadv_nc_fwd_flush(struct batadv_priv *bat_priv , struct batadv_nc_path *nc_path , struct batadv_nc_packet *nc_packet ) { unsigned long timeout ; int tmp ; bool tmp___0 ; int tmp___1 ; { timeout = (unsigned long )bat_priv->nc.max_fwd_delay; tmp = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp == 1) { tmp___0 = batadv_has_timed_out(nc_packet->timestamp, (unsigned int )timeout); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (0); } else { } } else { } batadv_add_counter___3(bat_priv, 5UL, 1UL); batadv_add_counter___3(bat_priv, 6UL, (size_t )((nc_packet->skb)->len + 14U)); list_del(& nc_packet->list); batadv_nc_send_packet(nc_packet); return (1); } } static void batadv_nc_process_nc_paths(struct batadv_priv *bat_priv , struct batadv_hashtable *hash , bool (*process_fn)(struct batadv_priv * , struct batadv_nc_path * , struct batadv_nc_packet * ) ) { struct hlist_head *head ; struct batadv_nc_packet *nc_packet ; struct batadv_nc_packet *nc_packet_tmp ; struct batadv_nc_path *nc_path ; bool ret ; int i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_nc_path *tmp___0 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___1 ; struct hlist_node const *__mptr___3 ; struct batadv_nc_path *tmp___2 ; { if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0; goto ldv_50129; ldv_50128: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_nc_path *)__mptr; } else { tmp___0 = (struct batadv_nc_path *)0; } nc_path = tmp___0; goto ldv_50126; ldv_50125: spin_lock_bh(& nc_path->packet_list_lock); __mptr___0 = (struct list_head const *)nc_path->packet_list.next; nc_packet = (struct batadv_nc_packet *)__mptr___0; __mptr___1 = (struct list_head const *)nc_packet->list.next; nc_packet_tmp = (struct batadv_nc_packet *)__mptr___1; goto ldv_50124; ldv_50123: ret = (*process_fn)(bat_priv, nc_path, nc_packet); if (! ret) { goto ldv_50122; } else { } nc_packet = nc_packet_tmp; __mptr___2 = (struct list_head const *)nc_packet_tmp->list.next; nc_packet_tmp = (struct batadv_nc_packet *)__mptr___2; ldv_50124: ; if ((unsigned long )(& nc_packet->list) != (unsigned long )(& nc_path->packet_list)) { goto ldv_50123; } else { } ldv_50122: spin_unlock_bh(& nc_path->packet_list_lock); _________p1___0 = *((struct hlist_node * volatile *)(& nc_path->hash_entry.next)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___3 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_nc_path *)__mptr___3; } else { tmp___2 = (struct batadv_nc_path *)0; } nc_path = tmp___2; ldv_50126: ; if ((unsigned long )nc_path != (unsigned long )((struct batadv_nc_path *)0)) { goto ldv_50125; } else { } rcu_read_unlock(); i = i + 1; ldv_50129: ; if ((uint32_t )i < hash->size) { goto ldv_50128; } else { } return; } } static void batadv_nc_worker(struct work_struct *work ) { struct delayed_work *delayed_work ; struct batadv_priv_nc *priv_nc ; struct batadv_priv *bat_priv ; unsigned long timeout ; struct work_struct const *__mptr ; struct delayed_work const *__mptr___0 ; struct batadv_priv_nc const *__mptr___1 ; bool tmp ; bool tmp___0 ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; priv_nc = (struct batadv_priv_nc *)__mptr___0; __mptr___1 = (struct batadv_priv_nc const *)priv_nc; bat_priv = (struct batadv_priv *)__mptr___1 + 0xfffffffffffff498UL; batadv_nc_purge_orig_hash(bat_priv); batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, & batadv_nc_to_purge_nc_path_coding); batadv_nc_purge_paths(bat_priv, bat_priv->nc.decoding_hash, & batadv_nc_to_purge_nc_path_decoding); timeout = (unsigned long )bat_priv->nc.max_fwd_delay; tmp = batadv_has_timed_out(bat_priv->nc.timestamp_fwd_flush, (unsigned int )timeout); if ((int )tmp) { batadv_nc_process_nc_paths(bat_priv, bat_priv->nc.coding_hash, & batadv_nc_fwd_flush); bat_priv->nc.timestamp_fwd_flush = jiffies; } else { } tmp___0 = batadv_has_timed_out(bat_priv->nc.timestamp_sniffed_purge, bat_priv->nc.max_buffer_time); if ((int )tmp___0) { batadv_nc_process_nc_paths(bat_priv, bat_priv->nc.decoding_hash, & batadv_nc_sniffed_purge); bat_priv->nc.timestamp_sniffed_purge = jiffies; } else { } batadv_nc_start_timer(bat_priv); return; } } static bool batadv_can_nc_with_orig(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_ogm_packet *ogm_packet ) { struct batadv_orig_ifinfo *orig_ifinfo ; uint32_t last_real_seqno ; uint8_t last_ttl ; __u32 tmp ; int tmp___0 ; { orig_ifinfo = batadv_orig_ifinfo_get(orig_node, (struct batadv_hard_iface *)0); if ((unsigned long )orig_ifinfo == (unsigned long )((struct batadv_orig_ifinfo *)0)) { return (0); } else { } last_ttl = orig_ifinfo->last_ttl; last_real_seqno = orig_ifinfo->last_real_seqno; batadv_orig_ifinfo_free_ref(orig_ifinfo); tmp = __fswab32(ogm_packet->seqno); if (tmp != last_real_seqno) { return (0); } else { } if ((int )last_ttl != (int )ogm_packet->ttl + 1) { return (0); } else { } tmp___0 = batadv_compare_eth((void const *)(& ogm_packet->orig), (void const *)(& ogm_packet->prev_sender)); if (tmp___0 == 0) { return (0); } else { } if ((int )ogm_packet->tq < (int )bat_priv->nc.min_tq) { return (0); } else { } return (1); } } static struct batadv_nc_node *batadv_nc_find_nc_node(struct batadv_orig_node *orig_node , struct batadv_orig_node *orig_neigh_node , bool in_coding ) { struct batadv_nc_node *nc_node ; struct batadv_nc_node *nc_node_out ; struct list_head *list ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; int tmp___1 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___2 ; { nc_node_out = (struct batadv_nc_node *)0; if ((int )in_coding) { list = & orig_neigh_node->in_coding_list; } else { list = & orig_neigh_node->out_coding_list; } rcu_read_lock(); __ptr = list->next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; nc_node = (struct batadv_nc_node *)__mptr; goto ldv_50177; ldv_50176: tmp___0 = batadv_compare_eth((void const *)(& nc_node->addr), (void const *)(& orig_node->orig)); if (tmp___0 == 0) { goto ldv_50174; } else { } tmp___1 = atomic_add_unless(& nc_node->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_50174; } else { } nc_node_out = nc_node; goto ldv_50175; ldv_50174: __ptr___0 = nc_node->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; nc_node = (struct batadv_nc_node *)__mptr___0; ldv_50177: ; if ((unsigned long )(& nc_node->list) != (unsigned long )list) { goto ldv_50176; } else { } ldv_50175: rcu_read_unlock(); return (nc_node_out); } } static struct batadv_nc_node *batadv_nc_get_nc_node(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_orig_node *orig_neigh_node , bool in_coding ) { struct batadv_nc_node *nc_node ; spinlock_t *lock ; struct list_head *list ; void *tmp ; int tmp___0 ; int tmp___1 ; { nc_node = batadv_nc_find_nc_node(orig_node, orig_neigh_node, (int )in_coding); if ((unsigned long )nc_node != (unsigned long )((struct batadv_nc_node *)0)) { return (nc_node); } else { } tmp = kzalloc(64UL, 32U); nc_node = (struct batadv_nc_node *)tmp; if ((unsigned long )nc_node == (unsigned long )((struct batadv_nc_node *)0)) { return ((struct batadv_nc_node *)0); } else { } tmp___0 = atomic_add_unless(& orig_neigh_node->refcount, 1, 0); if (tmp___0 == 0) { goto free; } else { } INIT_LIST_HEAD(& nc_node->list); ether_addr_copy((u8 *)(& nc_node->addr), (u8 const *)(& orig_node->orig)); nc_node->orig_node = orig_neigh_node; atomic_set(& nc_node->refcount, 2); if ((int )in_coding) { lock = & orig_neigh_node->in_coding_list_lock; list = & orig_neigh_node->in_coding_list; } else { lock = & orig_neigh_node->out_coding_list_lock; list = & orig_neigh_node->out_coding_list; } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 32) != 0) { batadv_debug_log(bat_priv, "Adding nc_node %pM -> %pM\n", (uint8_t *)(& nc_node->addr), (uint8_t *)(& (nc_node->orig_node)->orig)); } else { } spin_lock_bh(lock); list_add_tail_rcu(& nc_node->list, list); spin_unlock_bh(lock); return (nc_node); free: kfree((void const *)nc_node); return ((struct batadv_nc_node *)0); } } void batadv_nc_update_nc_node(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_orig_node *orig_neigh_node , struct batadv_ogm_packet *ogm_packet , int is_single_hop_neigh ) { struct batadv_nc_node *in_nc_node ; struct batadv_nc_node *out_nc_node ; int tmp ; bool tmp___0 ; int tmp___1 ; { in_nc_node = (struct batadv_nc_node *)0; out_nc_node = (struct batadv_nc_node *)0; tmp = atomic_read((atomic_t const *)(& bat_priv->network_coding)); if (tmp == 0) { goto out; } else { } if (((int )orig_node->capabilities & 2) == 0) { goto out; } else { } tmp___0 = batadv_can_nc_with_orig(bat_priv, orig_node, ogm_packet); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1 && is_single_hop_neigh == 0) { goto out; } else { } in_nc_node = batadv_nc_get_nc_node(bat_priv, orig_node, orig_neigh_node, 1); if ((unsigned long )in_nc_node == (unsigned long )((struct batadv_nc_node *)0)) { goto out; } else { } in_nc_node->last_seen = jiffies; out_nc_node = batadv_nc_get_nc_node(bat_priv, orig_neigh_node, orig_node, 0); if ((unsigned long )out_nc_node == (unsigned long )((struct batadv_nc_node *)0)) { goto out; } else { } out_nc_node->last_seen = jiffies; out: ; if ((unsigned long )in_nc_node != (unsigned long )((struct batadv_nc_node *)0)) { batadv_nc_node_free_ref(in_nc_node); } else { } if ((unsigned long )out_nc_node != (unsigned long )((struct batadv_nc_node *)0)) { batadv_nc_node_free_ref(out_nc_node); } else { } return; } } static struct batadv_nc_path *batadv_nc_get_path(struct batadv_priv *bat_priv , struct batadv_hashtable *hash , uint8_t *src , uint8_t *dst ) { int hash_added ; struct batadv_nc_path *nc_path ; struct batadv_nc_path nc_path_key ; void *tmp ; struct lock_class_key __key ; int tmp___0 ; { batadv_nc_hash_key_gen(& nc_path_key, (char const *)src, (char const *)dst); nc_path = batadv_nc_hash_find(hash, (void *)(& nc_path_key)); if ((unsigned long )nc_path != (unsigned long )((struct batadv_nc_path *)0)) { nc_path->last_valid = jiffies; return (nc_path); } else { } tmp = kzalloc(152UL, 32U); nc_path = (struct batadv_nc_path *)tmp; if ((unsigned long )nc_path == (unsigned long )((struct batadv_nc_path *)0)) { return ((struct batadv_nc_path *)0); } else { } INIT_LIST_HEAD(& nc_path->packet_list); spinlock_check(& nc_path->packet_list_lock); __raw_spin_lock_init(& nc_path->packet_list_lock.ldv_6347.rlock, "&(&nc_path->packet_list_lock)->rlock", & __key); atomic_set(& nc_path->refcount, 2); nc_path->last_valid = jiffies; ether_addr_copy((u8 *)(& nc_path->next_hop), (u8 const *)dst); ether_addr_copy((u8 *)(& nc_path->prev_hop), (u8 const *)src); tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 32) != 0) { batadv_debug_log(bat_priv, "Adding nc_path %pM -> %pM\n", (uint8_t *)(& nc_path->prev_hop), (uint8_t *)(& nc_path->next_hop)); } else { } hash_added = batadv_hash_add___2(hash, & batadv_nc_hash_compare, & batadv_nc_hash_choose, (void const *)(& nc_path_key), & nc_path->hash_entry); if (hash_added < 0) { kfree((void const *)nc_path); return ((struct batadv_nc_path *)0); } else { } return (nc_path); } } static uint8_t batadv_nc_random_weight_tq(uint8_t tq ) { uint8_t rand_val ; uint8_t rand_tq ; { get_random_bytes((void *)(& rand_val), 1); rand_tq = (int )((uint8_t )(255 - (int )tq)) * (int )rand_val; rand_tq = (uint8_t )((unsigned int )rand_tq / 255U); return (~ ((int )rand_tq)); } } static void batadv_nc_memxor(char *dst , char const *src , unsigned int len ) { unsigned int i ; { i = 0U; goto ldv_50220; ldv_50219: *(dst + (unsigned long )i) = (char )((int )((signed char )*(dst + (unsigned long )i)) ^ (int )((signed char )*(src + (unsigned long )i))); i = i + 1U; ldv_50220: ; if (i < len) { goto ldv_50219; } else { } return; } } static bool batadv_nc_code_packets(struct batadv_priv *bat_priv , struct sk_buff *skb , struct ethhdr *ethhdr , struct batadv_nc_packet *nc_packet , struct batadv_neigh_node *neigh_node ) { uint8_t tq_weighted_neigh ; uint8_t tq_weighted_coding ; uint8_t tq_tmp ; struct sk_buff *skb_dest ; struct sk_buff *skb_src ; struct batadv_unicast_packet *packet1 ; struct batadv_unicast_packet *packet2 ; struct batadv_coded_packet *coded_packet ; struct batadv_neigh_node *neigh_tmp ; struct batadv_neigh_node *router_neigh ; struct batadv_neigh_node *router_coding ; struct batadv_neigh_ifinfo *router_neigh_ifinfo ; struct batadv_neigh_ifinfo *router_coding_ifinfo ; uint8_t *first_source ; uint8_t *first_dest ; uint8_t *second_source ; uint8_t *second_dest ; __be32 packet_id1 ; __be32 packet_id2 ; size_t count ; bool res ; int coding_len ; int unicast_size ; int coded_size ; int header_add ; int tmp ; int tmp___0 ; __u16 tmp___1 ; { router_coding = (struct batadv_neigh_node *)0; router_neigh_ifinfo = (struct batadv_neigh_ifinfo *)0; router_coding_ifinfo = (struct batadv_neigh_ifinfo *)0; res = 0; unicast_size = 10; coded_size = 46; header_add = coded_size - unicast_size; router_neigh = batadv_orig_router_get(neigh_node->orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )router_neigh == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } router_neigh_ifinfo = batadv_neigh_ifinfo_get(router_neigh, (struct batadv_hard_iface *)0); if ((unsigned long )router_neigh_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } neigh_tmp = nc_packet->neigh_node; router_coding = batadv_orig_router_get(neigh_tmp->orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )router_coding == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } router_coding_ifinfo = batadv_neigh_ifinfo_get(router_coding, (struct batadv_hard_iface *)0); if ((unsigned long )router_coding_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } tq_tmp = router_neigh_ifinfo->bat_iv.tq_avg; tq_weighted_neigh = batadv_nc_random_weight_tq((int )tq_tmp); tq_tmp = router_coding_ifinfo->bat_iv.tq_avg; tq_weighted_coding = batadv_nc_random_weight_tq((int )tq_tmp); if ((int )tq_weighted_neigh >= (int )tq_weighted_coding) { first_dest = (uint8_t *)(& (nc_packet->nc_path)->next_hop); first_source = (uint8_t *)(& (nc_packet->nc_path)->prev_hop); second_dest = (uint8_t *)(& neigh_node->addr); second_source = (uint8_t *)(& ethhdr->h_source); packet1 = (struct batadv_unicast_packet *)(nc_packet->skb)->data; packet2 = (struct batadv_unicast_packet *)skb->data; packet_id1 = nc_packet->packet_id; packet_id2 = batadv_skb_crc32(skb, skb->data + 10U); } else { first_dest = (uint8_t *)(& neigh_node->addr); first_source = (uint8_t *)(& ethhdr->h_source); second_dest = (uint8_t *)(& (nc_packet->nc_path)->next_hop); second_source = (uint8_t *)(& (nc_packet->nc_path)->prev_hop); packet1 = (struct batadv_unicast_packet *)skb->data; packet2 = (struct batadv_unicast_packet *)(nc_packet->skb)->data; packet_id1 = batadv_skb_crc32(skb, skb->data + 10U); packet_id2 = nc_packet->packet_id; } if (skb->len <= (nc_packet->skb)->len) { skb_dest = nc_packet->skb; skb_src = skb; } else { skb_dest = skb; skb_src = nc_packet->skb; } coding_len = (int )(skb_src->len - (unsigned int )unicast_size); tmp = skb_linearize(skb_dest); if (tmp < 0) { goto out; } else { tmp___0 = skb_linearize(skb_src); if (tmp___0 < 0) { goto out; } else { } } skb_push(skb_dest, (unsigned int )header_add); coded_packet = (struct batadv_coded_packet *)skb_dest->data; skb_reset_mac_header(skb_dest); coded_packet->packet_type = 2U; coded_packet->version = 15U; coded_packet->ttl = packet1->ttl; ether_addr_copy((u8 *)(& coded_packet->first_source), (u8 const *)first_source); ether_addr_copy((u8 *)(& coded_packet->first_orig_dest), (u8 const *)(& packet1->dest)); coded_packet->first_crc = packet_id1; coded_packet->first_ttvn = packet1->ttvn; ether_addr_copy((u8 *)(& coded_packet->second_dest), (u8 const *)second_dest); ether_addr_copy((u8 *)(& coded_packet->second_source), (u8 const *)second_source); ether_addr_copy((u8 *)(& coded_packet->second_orig_dest), (u8 const *)(& packet2->dest)); coded_packet->second_crc = packet_id2; coded_packet->second_ttl = packet2->ttl; coded_packet->second_ttvn = packet2->ttvn; tmp___1 = __fswab16((int )((__u16 )coding_len)); coded_packet->coded_len = tmp___1; batadv_nc_memxor((char *)skb_dest->data + (unsigned long )coded_size, (char const *)skb_src->data + (unsigned long )unicast_size, (unsigned int )coding_len); if ((int )((struct batadv_skb_cb *)(& skb_src->cb))->decoded && (int )((struct batadv_skb_cb *)(& skb_dest->cb))->decoded) { count = (size_t )(skb_src->len + 14U); count = (size_t )(skb_dest->len + 14U) + count; batadv_add_counter___3(bat_priv, 30UL, 2UL); batadv_add_counter___3(bat_priv, 31UL, count); } else if (! ((struct batadv_skb_cb *)(& skb_src->cb))->decoded && ! ((struct batadv_skb_cb *)(& skb_dest->cb))->decoded) { count = (size_t )(skb_src->len + 14U); count = (size_t )(skb_dest->len + 14U) + count; batadv_add_counter___3(bat_priv, 28UL, 2UL); batadv_add_counter___3(bat_priv, 29UL, count); } else if ((int )((struct batadv_skb_cb *)(& skb_src->cb))->decoded && ! ((struct batadv_skb_cb *)(& skb_dest->cb))->decoded) { batadv_add_counter___3(bat_priv, 30UL, 1UL); batadv_add_counter___3(bat_priv, 31UL, (size_t )(skb_src->len + 14U)); batadv_add_counter___3(bat_priv, 28UL, 1UL); batadv_add_counter___3(bat_priv, 29UL, (size_t )(skb_dest->len + 14U)); } else if (! ((struct batadv_skb_cb *)(& skb_src->cb))->decoded && (int )((struct batadv_skb_cb *)(& skb_dest->cb))->decoded) { batadv_add_counter___3(bat_priv, 28UL, 1UL); batadv_add_counter___3(bat_priv, 29UL, (size_t )(skb_src->len + 14U)); batadv_add_counter___3(bat_priv, 30UL, 1UL); batadv_add_counter___3(bat_priv, 31UL, (size_t )(skb_dest->len + 14U)); } else { } kfree_skb(skb_src); nc_packet->skb = (struct sk_buff *)0; batadv_nc_packet_free(nc_packet); batadv_send_skb_packet(skb_dest, neigh_node->if_incoming, (uint8_t const *)first_dest); res = 1; out: ; if ((unsigned long )router_neigh != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router_neigh); } else { } if ((unsigned long )router_coding != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router_coding); } else { } if ((unsigned long )router_neigh_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_neigh_ifinfo); } else { } if ((unsigned long )router_coding_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { batadv_neigh_ifinfo_free_ref(router_coding_ifinfo); } else { } return (res); } } static bool batadv_nc_skb_coding_possible(struct sk_buff *skb , uint8_t *dst , uint8_t *src ) { int tmp ; { if ((int )((struct batadv_skb_cb *)(& skb->cb))->decoded) { tmp = batadv_compare_eth((void const *)dst, (void const *)src); if (tmp == 0) { return (0); } else { return (1); } } else { return (1); } } } static struct batadv_nc_packet *batadv_nc_path_search(struct batadv_priv *bat_priv , struct batadv_nc_node *in_nc_node , struct batadv_nc_node *out_nc_node , struct sk_buff *skb , uint8_t *eth_dst ) { struct batadv_nc_path *nc_path ; struct batadv_nc_path nc_path_key ; struct batadv_nc_packet *nc_packet_out ; struct batadv_nc_packet *nc_packet ; struct batadv_nc_packet *nc_packet_tmp ; struct batadv_hashtable *hash ; int idx ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_nc_path *tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; bool tmp___5 ; int tmp___6 ; struct list_head const *__mptr___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___7 ; struct hlist_node const *__mptr___3 ; struct batadv_nc_path *tmp___8 ; { nc_packet_out = (struct batadv_nc_packet *)0; hash = bat_priv->nc.coding_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_nc_packet *)0); } else { } batadv_nc_hash_key_gen(& nc_path_key, (char const *)(& in_nc_node->addr), (char const *)(& out_nc_node->addr)); tmp = batadv_nc_hash_choose((void const *)(& nc_path_key), hash->size); idx = (int )tmp; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& (hash->table + (unsigned long )idx)->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_nc_path *)__mptr; } else { tmp___1 = (struct batadv_nc_path *)0; } nc_path = tmp___1; goto ldv_50307; ldv_50306: tmp___2 = batadv_compare_eth((void const *)(& nc_path->prev_hop), (void const *)(& in_nc_node->addr)); if (tmp___2 == 0) { goto ldv_50294; } else { } tmp___3 = batadv_compare_eth((void const *)(& nc_path->next_hop), (void const *)(& out_nc_node->addr)); if (tmp___3 == 0) { goto ldv_50294; } else { } spin_lock_bh(& nc_path->packet_list_lock); tmp___4 = list_empty((struct list_head const *)(& nc_path->packet_list)); if (tmp___4 != 0) { spin_unlock_bh(& nc_path->packet_list_lock); goto ldv_50294; } else { } __mptr___0 = (struct list_head const *)nc_path->packet_list.next; nc_packet = (struct batadv_nc_packet *)__mptr___0; __mptr___1 = (struct list_head const *)nc_packet->list.next; nc_packet_tmp = (struct batadv_nc_packet *)__mptr___1; goto ldv_50304; ldv_50303: tmp___5 = batadv_nc_skb_coding_possible(nc_packet->skb, eth_dst, (uint8_t *)(& in_nc_node->addr)); if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { goto ldv_50301; } else { } list_del(& nc_packet->list); nc_packet_out = nc_packet; goto ldv_50302; ldv_50301: nc_packet = nc_packet_tmp; __mptr___2 = (struct list_head const *)nc_packet_tmp->list.next; nc_packet_tmp = (struct batadv_nc_packet *)__mptr___2; ldv_50304: ; if ((unsigned long )(& nc_packet->list) != (unsigned long )(& nc_path->packet_list)) { goto ldv_50303; } else { } ldv_50302: spin_unlock_bh(& nc_path->packet_list_lock); goto ldv_50305; ldv_50294: _________p1___0 = *((struct hlist_node * volatile *)(& nc_path->hash_entry.next)); tmp___7 = debug_lockdep_rcu_enabled(); if (tmp___7 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___3 = (struct hlist_node const *)____ptr___0; tmp___8 = (struct batadv_nc_path *)__mptr___3; } else { tmp___8 = (struct batadv_nc_path *)0; } nc_path = tmp___8; ldv_50307: ; if ((unsigned long )nc_path != (unsigned long )((struct batadv_nc_path *)0)) { goto ldv_50306; } else { } ldv_50305: rcu_read_unlock(); return (nc_packet_out); } } static struct batadv_nc_packet *batadv_nc_skb_src_search(struct batadv_priv *bat_priv , struct sk_buff *skb , uint8_t *eth_dst , uint8_t *eth_src , struct batadv_nc_node *in_nc_node ) { struct batadv_orig_node *orig_node ; struct batadv_nc_node *out_nc_node ; struct batadv_nc_packet *nc_packet ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; bool tmp___0 ; int tmp___1 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___2 ; { nc_packet = (struct batadv_nc_packet *)0; orig_node = batadv_orig_hash_find___4(bat_priv, (void const *)eth_src); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return ((struct batadv_nc_packet *)0); } else { } rcu_read_lock(); __ptr = orig_node->out_coding_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; out_nc_node = (struct batadv_nc_node *)__mptr; goto ldv_50335; ldv_50334: tmp___0 = batadv_nc_skb_coding_possible(skb, (uint8_t *)(& out_nc_node->addr), eth_src); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_50332; } else { } nc_packet = batadv_nc_path_search(bat_priv, in_nc_node, out_nc_node, skb, eth_dst); if ((unsigned long )nc_packet != (unsigned long )((struct batadv_nc_packet *)0)) { goto ldv_50333; } else { } ldv_50332: __ptr___0 = out_nc_node->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; out_nc_node = (struct batadv_nc_node *)__mptr___0; ldv_50335: ; if ((unsigned long )(& out_nc_node->list) != (unsigned long )(& orig_node->out_coding_list)) { goto ldv_50334; } else { } ldv_50333: rcu_read_unlock(); batadv_orig_node_free_ref(orig_node); return (nc_packet); } } static void batadv_nc_skb_store_before_coding(struct batadv_priv *bat_priv , struct sk_buff *skb , uint8_t *eth_dst_new ) { struct ethhdr *ethhdr ; { skb = pskb_copy_for_clone(skb, 32U); if ((unsigned long )skb == (unsigned long )((struct sk_buff *)0)) { return; } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); ether_addr_copy((u8 *)(& ethhdr->h_source), (u8 const *)(& ethhdr->h_dest)); ether_addr_copy((u8 *)(& ethhdr->h_dest), (u8 const *)eth_dst_new); skb_push(skb, 14U); batadv_nc_skb_store_for_decoding(bat_priv, skb); kfree_skb(skb); return; } } static bool batadv_nc_skb_dst_search(struct sk_buff *skb , struct batadv_neigh_node *neigh_node , struct ethhdr *ethhdr ) { struct net_device *netdev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_orig_node *orig_node ; struct batadv_nc_node *nc_node ; struct batadv_nc_packet *nc_packet ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp___0 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; bool tmp___2 ; { netdev = (neigh_node->if_incoming)->soft_iface; tmp = netdev_priv((struct net_device const *)netdev); bat_priv = (struct batadv_priv *)tmp; orig_node = neigh_node->orig_node; nc_packet = (struct batadv_nc_packet *)0; rcu_read_lock(); __ptr = orig_node->in_coding_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; nc_node = (struct batadv_nc_node *)__mptr; goto ldv_50368; ldv_50367: nc_packet = batadv_nc_skb_src_search(bat_priv, skb, (uint8_t *)(& neigh_node->addr), (uint8_t *)(& ethhdr->h_source), nc_node); if ((unsigned long )nc_packet != (unsigned long )((struct batadv_nc_packet *)0)) { goto ldv_50366; } else { } __ptr___0 = nc_node->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; nc_node = (struct batadv_nc_node *)__mptr___0; ldv_50368: ; if ((unsigned long )(& nc_node->list) != (unsigned long )(& orig_node->in_coding_list)) { goto ldv_50367; } else { } ldv_50366: rcu_read_unlock(); if ((unsigned long )nc_packet == (unsigned long )((struct batadv_nc_packet *)0)) { return (0); } else { } batadv_nc_skb_store_before_coding(bat_priv, skb, (uint8_t *)(& neigh_node->addr)); batadv_nc_skb_store_before_coding(bat_priv, nc_packet->skb, (uint8_t *)(& (nc_packet->neigh_node)->addr)); tmp___2 = batadv_nc_code_packets(bat_priv, skb, ethhdr, nc_packet, neigh_node); if ((int )tmp___2) { return (1); } else { } batadv_nc_send_packet(nc_packet); return (0); } } static bool batadv_nc_skb_add_to_path(struct sk_buff *skb , struct batadv_nc_path *nc_path , struct batadv_neigh_node *neigh_node , __be32 packet_id ) { struct batadv_nc_packet *nc_packet ; void *tmp ; { tmp = kzalloc(56UL, 32U); nc_packet = (struct batadv_nc_packet *)tmp; if ((unsigned long )nc_packet == (unsigned long )((struct batadv_nc_packet *)0)) { return (0); } else { } nc_packet->timestamp = jiffies; nc_packet->packet_id = packet_id; nc_packet->skb = skb; nc_packet->neigh_node = neigh_node; nc_packet->nc_path = nc_path; spin_lock_bh(& nc_path->packet_list_lock); list_add_tail(& nc_packet->list, & nc_path->packet_list); spin_unlock_bh(& nc_path->packet_list_lock); return (1); } } bool batadv_nc_skb_forward(struct sk_buff *skb , struct batadv_neigh_node *neigh_node ) { struct net_device const *netdev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_unicast_packet *packet ; struct batadv_nc_path *nc_path ; struct ethhdr *ethhdr ; struct ethhdr *tmp___0 ; __be32 packet_id ; u8 *payload ; int tmp___1 ; unsigned char *tmp___2 ; bool tmp___3 ; bool tmp___4 ; int tmp___5 ; { netdev = (struct net_device const *)(neigh_node->if_incoming)->soft_iface; tmp = netdev_priv(netdev); bat_priv = (struct batadv_priv *)tmp; tmp___0 = eth_hdr((struct sk_buff const *)skb); ethhdr = tmp___0; tmp___1 = atomic_read((atomic_t const *)(& bat_priv->network_coding)); if (tmp___1 == 0) { goto out; } else { } tmp___2 = skb_network_header((struct sk_buff const *)skb); payload = tmp___2; packet = (struct batadv_unicast_packet *)payload; if ((unsigned int )packet->packet_type != 64U) { goto out; } else { } tmp___3 = batadv_nc_skb_dst_search(skb, neigh_node, ethhdr); if ((int )tmp___3) { return (1); } else { } nc_path = batadv_nc_get_path(bat_priv, bat_priv->nc.coding_hash, (uint8_t *)(& ethhdr->h_source), (uint8_t *)(& neigh_node->addr)); if ((unsigned long )nc_path == (unsigned long )((struct batadv_nc_path *)0)) { goto out; } else { } packet_id = batadv_skb_crc32(skb, payload + 10UL); tmp___4 = batadv_nc_skb_add_to_path(skb, nc_path, neigh_node, packet_id); if (tmp___4) { tmp___5 = 0; } else { tmp___5 = 1; } if (tmp___5) { goto free_nc_path; } else { } return (1); free_nc_path: batadv_nc_path_free_ref(nc_path); out: ; return (0); } } void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv , struct sk_buff *skb ) { struct batadv_unicast_packet *packet ; struct batadv_nc_path *nc_path ; struct ethhdr *ethhdr ; struct ethhdr *tmp ; __be32 packet_id ; u8 *payload ; int tmp___0 ; unsigned char *tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; unsigned char *tmp___5 ; long tmp___6 ; bool tmp___7 ; int tmp___8 ; { tmp = eth_hdr((struct sk_buff const *)skb); ethhdr = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->network_coding)); if (tmp___0 == 0) { goto out; } else { } tmp___1 = skb_network_header((struct sk_buff const *)skb); payload = tmp___1; packet = (struct batadv_unicast_packet *)payload; if ((unsigned int )packet->packet_type != 64U) { goto out; } else { } nc_path = batadv_nc_get_path(bat_priv, bat_priv->nc.decoding_hash, (uint8_t *)(& ethhdr->h_source), (uint8_t *)(& ethhdr->h_dest)); if ((unsigned long )nc_path == (unsigned long )((struct batadv_nc_path *)0)) { goto out; } else { } skb = ldv_skb_clone_570(skb, 32U); tmp___2 = ldv__builtin_expect((unsigned long )skb == (unsigned long )((struct sk_buff *)0), 0L); if (tmp___2 != 0L) { goto free_nc_path; } else { } tmp___3 = pskb_may_pull(skb, 14U); tmp___4 = ldv__builtin_expect(tmp___3 == 0, 0L); if (tmp___4 != 0L) { goto free_skb; } else { } tmp___5 = skb_pull_rcsum(skb, 14U); tmp___6 = ldv__builtin_expect((unsigned long )tmp___5 == (unsigned long )((unsigned char *)0U), 0L); if (tmp___6 != 0L) { goto free_skb; } else { } packet_id = batadv_skb_crc32(skb, payload + 10UL); tmp___7 = batadv_nc_skb_add_to_path(skb, nc_path, (struct batadv_neigh_node *)0, packet_id); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { goto free_skb; } else { } batadv_add_counter___3(bat_priv, 32UL, 1UL); return; free_skb: kfree_skb(skb); free_nc_path: batadv_nc_path_free_ref(nc_path); out: ; return; } } void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv , struct sk_buff *skb ) { struct ethhdr *ethhdr ; struct ethhdr *tmp ; int tmp___0 ; { tmp = eth_hdr((struct sk_buff const *)skb); ethhdr = tmp; tmp___0 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& ethhdr->h_dest)); if (tmp___0 != 0) { return; } else { } skb_push(skb, 14U); batadv_nc_skb_store_for_decoding(bat_priv, skb); return; } } static struct batadv_unicast_packet *batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv , struct sk_buff *skb , struct batadv_nc_packet *nc_packet ) { int h_size ; int h_diff ; struct batadv_unicast_packet *unicast_packet ; struct batadv_coded_packet coded_packet_tmp ; struct ethhdr *ethhdr ; struct ethhdr ethhdr_tmp ; uint8_t *orig_dest ; uint8_t ttl ; uint8_t ttvn ; unsigned int coding_len ; int err ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; unsigned char *tmp ; unsigned char *tmp___0 ; int tmp___1 ; unsigned char *tmp___2 ; long tmp___3 ; int tmp___4 ; __u16 tmp___5 ; { h_size = 10; h_diff = (int const )(46U - (unsigned int )h_size); __len = 46UL; if (__len > 63UL) { __ret = __memcpy((void *)(& coded_packet_tmp), (void const *)skb->data, __len); } else { __ret = __builtin_memcpy((void *)(& coded_packet_tmp), (void const *)skb->data, __len); } __len___0 = 14UL; if (__len___0 > 63UL) { tmp = skb_mac_header((struct sk_buff const *)skb); __ret___0 = __memcpy((void *)(& ethhdr_tmp), (void const *)tmp, __len___0); } else { tmp___0 = skb_mac_header((struct sk_buff const *)skb); __ret___0 = __builtin_memcpy((void *)(& ethhdr_tmp), (void const *)tmp___0, __len___0); } tmp___1 = skb_cow(skb, 0U); if (tmp___1 < 0) { return ((struct batadv_unicast_packet *)0); } else { } tmp___2 = skb_pull_rcsum(skb, (unsigned int )h_diff); tmp___3 = ldv__builtin_expect((unsigned long )tmp___2 == (unsigned long )((unsigned char *)0U), 0L); if (tmp___3 != 0L) { return ((struct batadv_unicast_packet *)0); } else { } skb_set_mac_header(skb, -14); skb_reset_network_header(skb); ethhdr = eth_hdr((struct sk_buff const *)skb); *ethhdr = ethhdr_tmp; tmp___4 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& coded_packet_tmp.second_dest)); if (tmp___4 != 0) { ether_addr_copy((u8 *)(& ethhdr->h_dest), (u8 const *)(& coded_packet_tmp.second_dest)); skb->pkt_type = 0U; orig_dest = (uint8_t *)(& coded_packet_tmp.second_orig_dest); ttl = coded_packet_tmp.second_ttl; ttvn = coded_packet_tmp.second_ttvn; } else { orig_dest = (uint8_t *)(& coded_packet_tmp.first_orig_dest); ttl = coded_packet_tmp.ttl; ttvn = coded_packet_tmp.first_ttvn; } tmp___5 = __fswab16((int )coded_packet_tmp.coded_len); coding_len = (unsigned int )tmp___5; if (skb->len < coding_len) { return ((struct batadv_unicast_packet *)0); } else { } batadv_nc_memxor((char *)skb->data + (unsigned long )h_size, (char const *)(nc_packet->skb)->data + (unsigned long )h_size, coding_len); if ((nc_packet->skb)->len > coding_len + (unsigned int )h_size) { err = pskb_trim_rcsum(skb, coding_len + (unsigned int )h_size); if (err != 0) { return ((struct batadv_unicast_packet *)0); } else { } } else { } unicast_packet = (struct batadv_unicast_packet *)skb->data; unicast_packet->packet_type = 64U; unicast_packet->version = 15U; unicast_packet->ttl = ttl; ether_addr_copy((u8 *)(& unicast_packet->dest), (u8 const *)orig_dest); unicast_packet->ttvn = ttvn; batadv_nc_packet_free(nc_packet); return (unicast_packet); } } static struct batadv_nc_packet *batadv_nc_find_decoding_packet(struct batadv_priv *bat_priv , struct ethhdr *ethhdr , struct batadv_coded_packet *coded ) { struct batadv_hashtable *hash ; struct batadv_nc_packet *tmp_nc_packet ; struct batadv_nc_packet *nc_packet ; struct batadv_nc_path *nc_path ; struct batadv_nc_path nc_path_key ; uint8_t *dest ; uint8_t *source ; __be32 packet_id ; int index ; int tmp ; uint32_t tmp___0 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___1 ; struct hlist_node const *__mptr ; struct batadv_nc_path *tmp___2 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___2 ; struct batadv_nc_path *tmp___4 ; int tmp___5 ; { hash = bat_priv->nc.decoding_hash; nc_packet = (struct batadv_nc_packet *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_nc_packet *)0); } else { } dest = (uint8_t *)(& ethhdr->h_source); tmp = batadv_is_my_mac(bat_priv, (uint8_t const *)(& coded->second_dest)); if (tmp == 0) { source = (uint8_t *)(& coded->second_source); packet_id = coded->second_crc; } else { source = (uint8_t *)(& coded->first_source); packet_id = coded->first_crc; } batadv_nc_hash_key_gen(& nc_path_key, (char const *)source, (char const *)dest); tmp___0 = batadv_nc_hash_choose((void const *)(& nc_path_key), hash->size); index = (int )tmp___0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& (hash->table + (unsigned long )index)->first)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___2 = (struct batadv_nc_path *)__mptr; } else { tmp___2 = (struct batadv_nc_path *)0; } nc_path = tmp___2; goto ldv_50471; ldv_50470: spin_lock_bh(& nc_path->packet_list_lock); __mptr___0 = (struct list_head const *)nc_path->packet_list.next; tmp_nc_packet = (struct batadv_nc_packet *)__mptr___0; goto ldv_50468; ldv_50467: ; if (tmp_nc_packet->packet_id == packet_id) { list_del(& tmp_nc_packet->list); nc_packet = tmp_nc_packet; goto ldv_50466; } else { } __mptr___1 = (struct list_head const *)tmp_nc_packet->list.next; tmp_nc_packet = (struct batadv_nc_packet *)__mptr___1; ldv_50468: ; if ((unsigned long )(& tmp_nc_packet->list) != (unsigned long )(& nc_path->packet_list)) { goto ldv_50467; } else { } ldv_50466: spin_unlock_bh(& nc_path->packet_list_lock); if ((unsigned long )nc_packet != (unsigned long )((struct batadv_nc_packet *)0)) { goto ldv_50469; } else { } _________p1___0 = *((struct hlist_node * volatile *)(& nc_path->hash_entry.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___2 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_nc_path *)__mptr___2; } else { tmp___4 = (struct batadv_nc_path *)0; } nc_path = tmp___4; ldv_50471: ; if ((unsigned long )nc_path != (unsigned long )((struct batadv_nc_path *)0)) { goto ldv_50470; } else { } ldv_50469: rcu_read_unlock(); if ((unsigned long )nc_packet == (unsigned long )((struct batadv_nc_packet *)0)) { tmp___5 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___5 & 32) != 0) { batadv_debug_log(bat_priv, "No decoding packet found for %u\n", packet_id); } else { } } else { } return (nc_packet); } } static int batadv_nc_recv_coded_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_unicast_packet *unicast_packet ; struct batadv_coded_packet *coded_packet ; struct batadv_nc_packet *nc_packet ; struct ethhdr *ethhdr ; int hdr_size ; int tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; hdr_size = 46; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->network_coding)); if (tmp___0 == 0) { return (1); } else { } tmp___1 = pskb_may_pull(skb, (unsigned int )hdr_size); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { return (1); } else { } coded_packet = (struct batadv_coded_packet *)skb->data; ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___3 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& ethhdr->h_dest)); if (tmp___3 == 0) { tmp___4 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& coded_packet->second_dest)); if (tmp___4 == 0) { return (1); } else { } } else { } tmp___5 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& coded_packet->second_dest)); if (tmp___5 != 0) { batadv_add_counter___3(bat_priv, 36UL, 1UL); } else { } nc_packet = batadv_nc_find_decoding_packet(bat_priv, ethhdr, coded_packet); if ((unsigned long )nc_packet == (unsigned long )((struct batadv_nc_packet *)0)) { batadv_add_counter___3(bat_priv, 35UL, 1UL); return (1); } else { } tmp___6 = skb_linearize(skb); if (tmp___6 < 0) { goto free_nc_packet; } else { } tmp___7 = skb_linearize(nc_packet->skb); if (tmp___7 < 0) { goto free_nc_packet; } else { } unicast_packet = batadv_nc_skb_decode_packet(bat_priv, skb, nc_packet); if ((unsigned long )unicast_packet == (unsigned long )((struct batadv_unicast_packet *)0)) { batadv_add_counter___3(bat_priv, 35UL, 1UL); goto free_nc_packet; } else { } ((struct batadv_skb_cb *)(& skb->cb))->decoded = 1; batadv_add_counter___3(bat_priv, 33UL, 1UL); batadv_add_counter___3(bat_priv, 34UL, (size_t )(skb->len + 14U)); tmp___8 = batadv_recv_unicast_packet(skb, recv_if); return (tmp___8); free_nc_packet: batadv_nc_packet_free(nc_packet); return (1); } } void batadv_nc_mesh_free(struct batadv_priv *bat_priv ) { { batadv_tvlv_container_unregister(bat_priv, 3, 1); batadv_tvlv_handler_unregister(bat_priv, 3, 1); cancel_delayed_work_sync(& bat_priv->nc.work); batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, (bool (*)(struct batadv_priv * , struct batadv_nc_path * ))0); batadv_hash_destroy(bat_priv->nc.coding_hash); batadv_nc_purge_paths(bat_priv, bat_priv->nc.decoding_hash, (bool (*)(struct batadv_priv * , struct batadv_nc_path * ))0); batadv_hash_destroy(bat_priv->nc.decoding_hash); return; } } int batadv_nc_nodes_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct batadv_hard_iface *primary_if ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_nc_node *nc_node ; int i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct list_head *__ptr ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___1 ; struct list_head *_________p1___1 ; bool __warned___1 ; int tmp___5 ; struct list_head *__ptr___1 ; struct list_head const *__mptr___2 ; struct list_head *_________p1___2 ; bool __warned___2 ; int tmp___6 ; struct list_head *__ptr___2 ; struct list_head const *__mptr___3 ; struct list_head *_________p1___3 ; bool __warned___3 ; int tmp___7 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___4 ; bool __warned___4 ; int tmp___8 ; struct hlist_node const *__mptr___4 ; struct batadv_orig_node *tmp___9 ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->orig_hash; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } i = 0; goto ldv_50558; ldv_50557: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_50555; ldv_50554: tmp___2 = list_empty((struct list_head const *)(& orig_node->in_coding_list)); if (tmp___2 != 0) { tmp___3 = list_empty((struct list_head const *)(& orig_node->out_coding_list)); if (tmp___3 != 0) { goto ldv_50519; } else { } } else { } seq_printf(seq, "Node: %pM\n", (uint8_t *)(& orig_node->orig)); seq_puts(seq, " Ingoing: "); __ptr = orig_node->in_coding_list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; nc_node = (struct batadv_nc_node *)__mptr___0; goto ldv_50535; ldv_50534: seq_printf(seq, "%pM ", (uint8_t *)(& nc_node->addr)); __ptr___0 = nc_node->list.next; _________p1___1 = *((struct list_head * volatile *)(& __ptr___0)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___1) { rcu_read_lock_held(); } else { } __mptr___1 = (struct list_head const *)_________p1___1; nc_node = (struct batadv_nc_node *)__mptr___1; ldv_50535: ; if ((unsigned long )(& nc_node->list) != (unsigned long )(& orig_node->in_coding_list)) { goto ldv_50534; } else { } seq_puts(seq, "\n"); seq_puts(seq, " Outgoing: "); __ptr___1 = orig_node->out_coding_list.next; _________p1___2 = *((struct list_head * volatile *)(& __ptr___1)); tmp___6 = debug_lockdep_rcu_enabled(); if (tmp___6 != 0 && ! __warned___2) { rcu_read_lock_held(); } else { } __mptr___2 = (struct list_head const *)_________p1___2; nc_node = (struct batadv_nc_node *)__mptr___2; goto ldv_50552; ldv_50551: seq_printf(seq, "%pM ", (uint8_t *)(& nc_node->addr)); __ptr___2 = nc_node->list.next; _________p1___3 = *((struct list_head * volatile *)(& __ptr___2)); tmp___7 = debug_lockdep_rcu_enabled(); if (tmp___7 != 0 && ! __warned___3) { rcu_read_lock_held(); } else { } __mptr___3 = (struct list_head const *)_________p1___3; nc_node = (struct batadv_nc_node *)__mptr___3; ldv_50552: ; if ((unsigned long )(& nc_node->list) != (unsigned long )(& orig_node->out_coding_list)) { goto ldv_50551; } else { } seq_puts(seq, "\n\n"); ldv_50519: _________p1___4 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___8 = debug_lockdep_rcu_enabled(); if (tmp___8 != 0 && ! __warned___4) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___4; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___4 = (struct hlist_node const *)____ptr___0; tmp___9 = (struct batadv_orig_node *)__mptr___4 + 0xfffffffffffffe88UL; } else { tmp___9 = (struct batadv_orig_node *)0; } orig_node = tmp___9; ldv_50555: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_50554; } else { } rcu_read_unlock(); i = i + 1; ldv_50558: ; if ((uint32_t )i < hash->size) { goto ldv_50557; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } int batadv_nc_init_debugfs(struct batadv_priv *bat_priv ) { struct dentry *nc_dir ; struct dentry *file ; { nc_dir = debugfs_create_dir("nc", bat_priv->debug_dir); if ((unsigned long )nc_dir == (unsigned long )((struct dentry *)0)) { goto out; } else { } file = debugfs_create_u8("min_tq", 420, nc_dir, & bat_priv->nc.min_tq); if ((unsigned long )file == (unsigned long )((struct dentry *)0)) { goto out; } else { } file = debugfs_create_u32("max_fwd_delay", 420, nc_dir, & bat_priv->nc.max_fwd_delay); if ((unsigned long )file == (unsigned long )((struct dentry *)0)) { goto out; } else { } file = debugfs_create_u32("max_buffer_time", 420, nc_dir, & bat_priv->nc.max_buffer_time); if ((unsigned long )file == (unsigned long )((struct dentry *)0)) { goto out; } else { } return (0); out: ; return (-12); } } void *ldv_kmem_cache_alloc_552(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_558(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_560(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_562(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_563(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_564(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_565(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_566(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_567(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_568(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_569(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } struct sk_buff *ldv_skb_clone_570(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_598(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_615(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; __inline static void list_add_rcu(struct list_head *new , struct list_head *head ) { { __list_add_rcu(new, head, head->next); return; } } struct sk_buff *ldv_skb_clone_606(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_614(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_608(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_604(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_612(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_613(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_609(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_610(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_611(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node ) ; struct batadv_orig_node_vlan *batadv_orig_node_vlan_new(struct batadv_orig_node *orig_node , unsigned short vid ) ; struct batadv_orig_node_vlan *batadv_orig_node_vlan_get(struct batadv_orig_node *orig_node , unsigned short vid ) ; void batadv_orig_node_vlan_free_ref(struct batadv_orig_node_vlan *orig_vlan ) ; __inline static void batadv_dat_init_orig_node_addr(struct batadv_orig_node *orig_node ) { uint32_t addr ; { addr = batadv_choose_orig___2((void const *)(& orig_node->orig), 65535U); orig_node->dat_addr = (unsigned short )addr; return; } } __inline static void batadv_hardif_free_ref_now(struct batadv_hard_iface *hard_iface ) { int tmp ; { tmp = atomic_dec_and_test(& hard_iface->refcount); if (tmp != 0) { batadv_hardif_free_rcu(& hard_iface->rcu); } else { } return; } } __inline static bool batadv_frag_check_entry(struct batadv_frag_table_entry *frags_entry ) { int tmp ; bool tmp___0 ; { tmp = hlist_empty((struct hlist_head const *)(& frags_entry->head)); if (tmp == 0) { tmp___0 = batadv_has_timed_out(frags_entry->timestamp, 10000U); if ((int )tmp___0) { return (1); } else { return (0); } } else { return (0); } } } void batadv_mcast_purge_orig(struct batadv_orig_node *orig ) ; static struct lock_class_key batadv_orig_hash_lock_class_key ; static void batadv_purge_orig(struct work_struct *work ) ; int batadv_compare_orig(struct hlist_node const *node , void const *data2 ) { void const *data1 ; struct hlist_node const *__mptr ; int tmp ; { __mptr = node; data1 = (void const *)((struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL); tmp = batadv_compare_eth(data1, data2); return (tmp); } } struct batadv_orig_node_vlan *batadv_orig_node_vlan_get(struct batadv_orig_node *orig_node , unsigned short vid ) { struct batadv_orig_node_vlan *vlan ; struct batadv_orig_node_vlan *tmp ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___2 ; { vlan = (struct batadv_orig_node_vlan *)0; rcu_read_lock(); __ptr = orig_node->vlan_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; tmp = (struct batadv_orig_node_vlan *)__mptr + 0xfffffffffffffff0UL; goto ldv_49933; ldv_49932: ; if ((int )tmp->vid != (int )vid) { goto ldv_49930; } else { } tmp___1 = atomic_add_unless(& tmp->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_49930; } else { } vlan = tmp; goto ldv_49931; ldv_49930: __ptr___0 = tmp->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; tmp = (struct batadv_orig_node_vlan *)__mptr___0 + 0xfffffffffffffff0UL; ldv_49933: ; if ((unsigned long )(& tmp->list) != (unsigned long )(& orig_node->vlan_list)) { goto ldv_49932; } else { } ldv_49931: rcu_read_unlock(); return (vlan); } } struct batadv_orig_node_vlan *batadv_orig_node_vlan_new(struct batadv_orig_node *orig_node , unsigned short vid ) { struct batadv_orig_node_vlan *vlan ; void *tmp ; { spin_lock_bh(& orig_node->vlan_list_lock); vlan = batadv_orig_node_vlan_get(orig_node, (int )vid); if ((unsigned long )vlan != (unsigned long )((struct batadv_orig_node_vlan *)0)) { goto out; } else { } tmp = kzalloc(56UL, 32U); vlan = (struct batadv_orig_node_vlan *)tmp; if ((unsigned long )vlan == (unsigned long )((struct batadv_orig_node_vlan *)0)) { goto out; } else { } atomic_set(& vlan->refcount, 2); vlan->vid = vid; list_add_rcu(& vlan->list, & orig_node->vlan_list); out: spin_unlock_bh(& orig_node->vlan_list_lock); return (vlan); } } void batadv_orig_node_vlan_free_ref(struct batadv_orig_node_vlan *orig_vlan ) { int tmp ; { tmp = atomic_dec_and_test(& orig_vlan->refcount); if (tmp != 0) { kfree_call_rcu(& orig_vlan->rcu, (void (*)(struct callback_head * ))40); } else { } return; } } int batadv_originator_init(struct batadv_priv *bat_priv ) { struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___0 ; unsigned long tmp ; { if ((unsigned long )bat_priv->orig_hash != (unsigned long )((struct batadv_hashtable *)0)) { return (0); } else { } bat_priv->orig_hash = batadv_hash_new(1024U); if ((unsigned long )bat_priv->orig_hash == (unsigned long )((struct batadv_hashtable *)0)) { goto err; } else { } batadv_hash_set_lock_class(bat_priv->orig_hash, & batadv_orig_hash_lock_class_key); __init_work(& bat_priv->orig_work.work, 0); __constr_expr_0.counter = 137438953408L; bat_priv->orig_work.work.data = __constr_expr_0; lockdep_init_map(& bat_priv->orig_work.work.lockdep_map, "(&(&bat_priv->orig_work)->work)", & __key, 0); INIT_LIST_HEAD(& bat_priv->orig_work.work.entry); bat_priv->orig_work.work.func = & batadv_purge_orig; init_timer_key(& bat_priv->orig_work.timer, 2U, "(&(&bat_priv->orig_work)->timer)", & __key___0); bat_priv->orig_work.timer.function = & delayed_work_timer_fn; bat_priv->orig_work.timer.data = (unsigned long )(& bat_priv->orig_work); tmp = msecs_to_jiffies(1000U); queue_delayed_work(batadv_event_workqueue, & bat_priv->orig_work, tmp); return (0); err: ; return (-12); } } static void batadv_neigh_ifinfo_free_rcu(struct callback_head *rcu ) { struct batadv_neigh_ifinfo *neigh_ifinfo ; struct callback_head const *__mptr ; { __mptr = (struct callback_head const *)rcu; neigh_ifinfo = (struct batadv_neigh_ifinfo *)__mptr + 0xffffffffffffffc8UL; if ((unsigned long )neigh_ifinfo->if_outgoing != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref_now(neigh_ifinfo->if_outgoing); } else { } kfree((void const *)neigh_ifinfo); return; } } static void batadv_neigh_ifinfo_free_ref_now(struct batadv_neigh_ifinfo *neigh_ifinfo ) { int tmp ; { tmp = atomic_dec_and_test(& neigh_ifinfo->refcount); if (tmp != 0) { batadv_neigh_ifinfo_free_rcu(& neigh_ifinfo->rcu); } else { } return; } } void batadv_neigh_ifinfo_free_ref(struct batadv_neigh_ifinfo *neigh_ifinfo ) { int tmp ; { tmp = atomic_dec_and_test(& neigh_ifinfo->refcount); if (tmp != 0) { call_rcu_sched(& neigh_ifinfo->rcu, & batadv_neigh_ifinfo_free_rcu); } else { } return; } } static void batadv_neigh_node_free_rcu(struct callback_head *rcu ) { struct hlist_node *node_tmp ; struct batadv_neigh_node *neigh_node ; struct batadv_neigh_ifinfo *neigh_ifinfo ; struct callback_head const *__mptr ; struct hlist_node *____ptr ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_ifinfo *tmp ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_neigh_ifinfo *tmp___0 ; { __mptr = (struct callback_head const *)rcu; neigh_node = (struct batadv_neigh_node *)__mptr + 0xffffffffffffff78UL; ____ptr = neigh_node->ifinfo_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr; tmp = (struct batadv_neigh_ifinfo *)__mptr___0; } else { tmp = (struct batadv_neigh_ifinfo *)0; } neigh_ifinfo = tmp; goto ldv_49981; ldv_49980: batadv_neigh_ifinfo_free_ref_now(neigh_ifinfo); ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_neigh_ifinfo *)__mptr___1; } else { tmp___0 = (struct batadv_neigh_ifinfo *)0; } neigh_ifinfo = tmp___0; ldv_49981: ; if ((unsigned long )neigh_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { node_tmp = neigh_ifinfo->list.next; goto ldv_49980; } else { } batadv_hardif_free_ref_now(neigh_node->if_incoming); kfree((void const *)neigh_node); return; } } static void batadv_neigh_node_free_ref_now(struct batadv_neigh_node *neigh_node ) { int tmp ; { tmp = atomic_dec_and_test(& neigh_node->refcount); if (tmp != 0) { batadv_neigh_node_free_rcu(& neigh_node->rcu); } else { } return; } } void batadv_neigh_node_free_ref(struct batadv_neigh_node *neigh_node ) { int tmp ; { tmp = atomic_dec_and_test(& neigh_node->refcount); if (tmp != 0) { call_rcu_sched(& neigh_node->rcu, & batadv_neigh_node_free_rcu); } else { } return; } } struct batadv_neigh_node *batadv_orig_router_get(struct batadv_orig_node *orig_node , struct batadv_hard_iface const *if_outgoing ) { struct batadv_orig_ifinfo *orig_ifinfo ; struct batadv_neigh_node *router ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_orig_ifinfo *tmp___0 ; struct batadv_neigh_node *_________p1___0 ; bool __warned___0 ; int tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___1 ; bool __warned___1 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_ifinfo *tmp___4 ; int tmp___5 ; { router = (struct batadv_neigh_node *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& orig_node->ifinfo_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_orig_ifinfo *)__mptr; } else { tmp___0 = (struct batadv_orig_ifinfo *)0; } orig_ifinfo = tmp___0; goto ldv_50021; ldv_50020: ; if ((unsigned long )((struct batadv_hard_iface const *)orig_ifinfo->if_outgoing) != (unsigned long )if_outgoing) { goto ldv_50015; } else { } _________p1___0 = *((struct batadv_neigh_node * volatile *)(& orig_ifinfo->router)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { tmp___2 = rcu_read_lock_held(); if (tmp___2 == 0 && 1) { __warned___0 = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/originator.o.c.prepared", 413, "suspicious rcu_dereference_check() usage"); } else { } } else { } router = _________p1___0; goto ldv_50019; ldv_50015: _________p1___1 = *((struct hlist_node * volatile *)(& orig_ifinfo->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___1) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___1; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_orig_ifinfo *)__mptr___0; } else { tmp___4 = (struct batadv_orig_ifinfo *)0; } orig_ifinfo = tmp___4; ldv_50021: ; if ((unsigned long )orig_ifinfo != (unsigned long )((struct batadv_orig_ifinfo *)0)) { goto ldv_50020; } else { } ldv_50019: ; if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___5 = atomic_add_unless(& router->refcount, 1, 0); if (tmp___5 == 0) { router = (struct batadv_neigh_node *)0; } else { } } else { } rcu_read_unlock(); return (router); } } struct batadv_orig_ifinfo *batadv_orig_ifinfo_get(struct batadv_orig_node *orig_node , struct batadv_hard_iface *if_outgoing ) { struct batadv_orig_ifinfo *tmp ; struct batadv_orig_ifinfo *orig_ifinfo ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_ifinfo *tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_ifinfo *tmp___4 ; { orig_ifinfo = (struct batadv_orig_ifinfo *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& orig_node->ifinfo_list.first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_ifinfo *)__mptr; } else { tmp___1 = (struct batadv_orig_ifinfo *)0; } tmp = tmp___1; goto ldv_50051; ldv_50050: ; if ((unsigned long )tmp->if_outgoing != (unsigned long )if_outgoing) { goto ldv_50048; } else { } tmp___2 = atomic_add_unless(& tmp->refcount, 1, 0); if (tmp___2 == 0) { goto ldv_50048; } else { } orig_ifinfo = tmp; goto ldv_50049; ldv_50048: _________p1___0 = *((struct hlist_node * volatile *)(& tmp->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_orig_ifinfo *)__mptr___0; } else { tmp___4 = (struct batadv_orig_ifinfo *)0; } tmp = tmp___4; ldv_50051: ; if ((unsigned long )tmp != (unsigned long )((struct batadv_orig_ifinfo *)0)) { goto ldv_50050; } else { } ldv_50049: rcu_read_unlock(); return (orig_ifinfo); } } struct batadv_orig_ifinfo *batadv_orig_ifinfo_new(struct batadv_orig_node *orig_node , struct batadv_hard_iface *if_outgoing ) { struct batadv_orig_ifinfo *orig_ifinfo ; unsigned long reset_time ; void *tmp ; int tmp___0 ; unsigned long tmp___1 ; { orig_ifinfo = (struct batadv_orig_ifinfo *)0; spin_lock_bh(& orig_node->neigh_list_lock); orig_ifinfo = batadv_orig_ifinfo_get(orig_node, if_outgoing); if ((unsigned long )orig_ifinfo != (unsigned long )((struct batadv_orig_ifinfo *)0)) { goto out; } else { } tmp = kzalloc(72UL, 32U); orig_ifinfo = (struct batadv_orig_ifinfo *)tmp; if ((unsigned long )orig_ifinfo == (unsigned long )((struct batadv_orig_ifinfo *)0)) { goto out; } else { } if ((unsigned long )if_outgoing != (unsigned long )((struct batadv_hard_iface *)0)) { tmp___0 = atomic_add_unless(& if_outgoing->refcount, 1, 0); if (tmp___0 == 0) { kfree((void const *)orig_ifinfo); orig_ifinfo = (struct batadv_orig_ifinfo *)0; goto out; } else { } } else { } reset_time = (unsigned long )jiffies - 1UL; tmp___1 = msecs_to_jiffies(30000U); reset_time = reset_time - tmp___1; orig_ifinfo->batman_seqno_reset = reset_time; orig_ifinfo->if_outgoing = if_outgoing; INIT_HLIST_NODE(& orig_ifinfo->list); atomic_set(& orig_ifinfo->refcount, 2); hlist_add_head_rcu(& orig_ifinfo->list, & orig_node->ifinfo_list); out: spin_unlock_bh(& orig_node->neigh_list_lock); return (orig_ifinfo); } } struct batadv_neigh_ifinfo *batadv_neigh_ifinfo_get(struct batadv_neigh_node *neigh , struct batadv_hard_iface *if_outgoing ) { struct batadv_neigh_ifinfo *neigh_ifinfo ; struct batadv_neigh_ifinfo *tmp_neigh_ifinfo ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_neigh_ifinfo *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_ifinfo *tmp___3 ; { neigh_ifinfo = (struct batadv_neigh_ifinfo *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& neigh->ifinfo_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_neigh_ifinfo *)__mptr; } else { tmp___0 = (struct batadv_neigh_ifinfo *)0; } tmp_neigh_ifinfo = tmp___0; goto ldv_50088; ldv_50087: ; if ((unsigned long )tmp_neigh_ifinfo->if_outgoing != (unsigned long )if_outgoing) { goto ldv_50085; } else { } tmp___1 = atomic_add_unless(& tmp_neigh_ifinfo->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_50085; } else { } neigh_ifinfo = tmp_neigh_ifinfo; goto ldv_50086; ldv_50085: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_neigh_ifinfo->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_neigh_ifinfo *)__mptr___0; } else { tmp___3 = (struct batadv_neigh_ifinfo *)0; } tmp_neigh_ifinfo = tmp___3; ldv_50088: ; if ((unsigned long )tmp_neigh_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto ldv_50087; } else { } ldv_50086: rcu_read_unlock(); return (neigh_ifinfo); } } struct batadv_neigh_ifinfo *batadv_neigh_ifinfo_new(struct batadv_neigh_node *neigh , struct batadv_hard_iface *if_outgoing ) { struct batadv_neigh_ifinfo *neigh_ifinfo ; void *tmp ; int tmp___0 ; { spin_lock_bh(& neigh->ifinfo_lock); neigh_ifinfo = batadv_neigh_ifinfo_get(neigh, if_outgoing); if ((unsigned long )neigh_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } tmp = kzalloc(72UL, 32U); neigh_ifinfo = (struct batadv_neigh_ifinfo *)tmp; if ((unsigned long )neigh_ifinfo == (unsigned long )((struct batadv_neigh_ifinfo *)0)) { goto out; } else { } if ((unsigned long )if_outgoing != (unsigned long )((struct batadv_hard_iface *)0)) { tmp___0 = atomic_add_unless(& if_outgoing->refcount, 1, 0); if (tmp___0 == 0) { kfree((void const *)neigh_ifinfo); neigh_ifinfo = (struct batadv_neigh_ifinfo *)0; goto out; } else { } } else { } INIT_HLIST_NODE(& neigh_ifinfo->list); atomic_set(& neigh_ifinfo->refcount, 2); neigh_ifinfo->if_outgoing = if_outgoing; hlist_add_head_rcu(& neigh_ifinfo->list, & neigh->ifinfo_list); out: spin_unlock_bh(& neigh->ifinfo_lock); return (neigh_ifinfo); } } struct batadv_neigh_node *batadv_neigh_node_new(struct batadv_hard_iface *hard_iface , uint8_t const *neigh_addr , struct batadv_orig_node *orig_node ) { struct batadv_neigh_node *neigh_node ; void *tmp ; struct lock_class_key __key ; { tmp = kzalloc(152UL, 32U); neigh_node = (struct batadv_neigh_node *)tmp; if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } INIT_HLIST_NODE(& neigh_node->list); neigh_node->ifinfo_list.first = (struct hlist_node *)0; spinlock_check(& neigh_node->ifinfo_lock); __raw_spin_lock_init(& neigh_node->ifinfo_lock.ldv_6347.rlock, "&(&neigh_node->ifinfo_lock)->rlock", & __key); ether_addr_copy((u8 *)(& neigh_node->addr), neigh_addr); neigh_node->if_incoming = hard_iface; neigh_node->orig_node = orig_node; atomic_set(& neigh_node->refcount, 2); out: ; return (neigh_node); } } struct batadv_neigh_node *batadv_neigh_node_get(struct batadv_orig_node const *orig_node , struct batadv_hard_iface const *hard_iface , uint8_t const *addr ) { struct batadv_neigh_node *tmp_neigh_node ; struct batadv_neigh_node *res ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_neigh_node *tmp___0 ; int tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp___4 ; { res = (struct batadv_neigh_node *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& orig_node->neigh_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_neigh_node *)__mptr; } else { tmp___0 = (struct batadv_neigh_node *)0; } tmp_neigh_node = tmp___0; goto ldv_50133; ldv_50132: tmp___1 = batadv_compare_eth((void const *)(& tmp_neigh_node->addr), (void const *)addr); if (tmp___1 == 0) { goto ldv_50130; } else { } if ((unsigned long )((struct batadv_hard_iface const *)tmp_neigh_node->if_incoming) != (unsigned long )hard_iface) { goto ldv_50130; } else { } tmp___2 = atomic_add_unless(& tmp_neigh_node->refcount, 1, 0); if (tmp___2 == 0) { goto ldv_50130; } else { } res = tmp_neigh_node; goto ldv_50131; ldv_50130: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_neigh_node->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_neigh_node *)__mptr___0; } else { tmp___4 = (struct batadv_neigh_node *)0; } tmp_neigh_node = tmp___4; ldv_50133: ; if ((unsigned long )tmp_neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50132; } else { } ldv_50131: rcu_read_unlock(); return (res); } } static void batadv_orig_ifinfo_free_rcu(struct callback_head *rcu ) { struct batadv_orig_ifinfo *orig_ifinfo ; struct batadv_neigh_node *router ; struct callback_head const *__mptr ; int tmp ; { __mptr = (struct callback_head const *)rcu; orig_ifinfo = (struct batadv_orig_ifinfo *)__mptr + 0xffffffffffffffc8UL; if ((unsigned long )orig_ifinfo->if_outgoing != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref_now(orig_ifinfo->if_outgoing); } else { } tmp = debug_lockdep_rcu_enabled(); router = orig_ifinfo->router; if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref_now(router); } else { } kfree((void const *)orig_ifinfo); return; } } static void batadv_orig_ifinfo_free_ref_now(struct batadv_orig_ifinfo *orig_ifinfo ) { int tmp ; { tmp = atomic_dec_and_test(& orig_ifinfo->refcount); if (tmp != 0) { batadv_orig_ifinfo_free_rcu(& orig_ifinfo->rcu); } else { } return; } } void batadv_orig_ifinfo_free_ref(struct batadv_orig_ifinfo *orig_ifinfo ) { int tmp ; { tmp = atomic_dec_and_test(& orig_ifinfo->refcount); if (tmp != 0) { call_rcu_sched(& orig_ifinfo->rcu, & batadv_orig_ifinfo_free_rcu); } else { } return; } } static void batadv_orig_node_free_rcu(struct callback_head *rcu ) { struct hlist_node *node_tmp ; struct batadv_neigh_node *neigh_node ; struct batadv_orig_node *orig_node ; struct batadv_orig_ifinfo *orig_ifinfo ; struct callback_head const *__mptr ; struct hlist_node *____ptr ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_neigh_node *tmp___0 ; struct hlist_node *____ptr___1 ; struct hlist_node const *__mptr___2 ; struct batadv_orig_ifinfo *tmp___1 ; struct hlist_node *____ptr___2 ; struct hlist_node const *__mptr___3 ; struct batadv_orig_ifinfo *tmp___2 ; { __mptr = (struct callback_head const *)rcu; orig_node = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe20UL; spin_lock_bh(& orig_node->neigh_list_lock); ____ptr = orig_node->neigh_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr; tmp = (struct batadv_neigh_node *)__mptr___0; } else { tmp = (struct batadv_neigh_node *)0; } neigh_node = tmp; goto ldv_50168; ldv_50167: hlist_del_rcu(& neigh_node->list); batadv_neigh_node_free_ref_now(neigh_node); ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_neigh_node *)__mptr___1; } else { tmp___0 = (struct batadv_neigh_node *)0; } neigh_node = tmp___0; ldv_50168: ; if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { node_tmp = neigh_node->list.next; goto ldv_50167; } else { } ____ptr___1 = orig_node->ifinfo_list.first; if ((unsigned long )____ptr___1 != (unsigned long )((struct hlist_node *)0)) { __mptr___2 = (struct hlist_node const *)____ptr___1; tmp___1 = (struct batadv_orig_ifinfo *)__mptr___2; } else { tmp___1 = (struct batadv_orig_ifinfo *)0; } orig_ifinfo = tmp___1; goto ldv_50180; ldv_50179: hlist_del_rcu(& orig_ifinfo->list); batadv_orig_ifinfo_free_ref_now(orig_ifinfo); ____ptr___2 = node_tmp; if ((unsigned long )____ptr___2 != (unsigned long )((struct hlist_node *)0)) { __mptr___3 = (struct hlist_node const *)____ptr___2; tmp___2 = (struct batadv_orig_ifinfo *)__mptr___3; } else { tmp___2 = (struct batadv_orig_ifinfo *)0; } orig_ifinfo = tmp___2; ldv_50180: ; if ((unsigned long )orig_ifinfo != (unsigned long )((struct batadv_orig_ifinfo *)0)) { node_tmp = orig_ifinfo->list.next; goto ldv_50179; } else { } spin_unlock_bh(& orig_node->neigh_list_lock); batadv_mcast_purge_orig(orig_node); batadv_nc_purge_orig(orig_node->bat_priv, orig_node, (bool (*)(struct batadv_priv * , struct batadv_nc_node * ))0); batadv_frag_purge_orig(orig_node, (bool (*)(struct batadv_frag_table_entry * ))0); batadv_tt_global_del_orig(orig_node->bat_priv, orig_node, -1, "originator timed out"); if ((unsigned long )((orig_node->bat_priv)->bat_algo_ops)->bat_orig_free != (unsigned long )((void (*)(struct batadv_orig_node * ))0)) { (*(((orig_node->bat_priv)->bat_algo_ops)->bat_orig_free))(orig_node); } else { } kfree((void const *)orig_node->tt_buff); kfree((void const *)orig_node); return; } } void batadv_orig_node_free_ref(struct batadv_orig_node *orig_node ) { int tmp ; { tmp = atomic_dec_and_test(& orig_node->refcount); if (tmp != 0) { call_rcu_sched(& orig_node->rcu, & batadv_orig_node_free_rcu); } else { } return; } } void batadv_orig_node_free_ref_now(struct batadv_orig_node *orig_node ) { int tmp ; { tmp = atomic_dec_and_test(& orig_node->refcount); if (tmp != 0) { batadv_orig_node_free_rcu(& orig_node->rcu); } else { } return; } } void batadv_originator_free(struct batadv_priv *bat_priv ) { struct batadv_hashtable *hash ; struct hlist_node *node_tmp ; struct hlist_head *head ; spinlock_t *list_lock ; struct batadv_orig_node *orig_node ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___0 ; { hash = bat_priv->orig_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } cancel_delayed_work_sync(& bat_priv->orig_work); bat_priv->orig_hash = (struct batadv_hashtable *)0; i = 0U; goto ldv_50210; ldv_50209: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp = (struct batadv_orig_node *)0; } orig_node = tmp; goto ldv_50207; ldv_50206: hlist_del_rcu(& orig_node->hash_entry); batadv_orig_node_free_ref(orig_node); ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___0 = (struct batadv_orig_node *)0; } orig_node = tmp___0; ldv_50207: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { node_tmp = orig_node->hash_entry.next; goto ldv_50206; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_50210: ; if (hash->size > i) { goto ldv_50209; } else { } batadv_hash_destroy(hash); return; } } struct batadv_orig_node *batadv_orig_node_new(struct batadv_priv *bat_priv , uint8_t const *addr ) { struct batadv_orig_node *orig_node ; struct batadv_orig_node_vlan *vlan ; unsigned long reset_time ; int i ; int tmp ; void *tmp___0 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; struct lock_class_key __key___3 ; unsigned long tmp___1 ; struct lock_class_key __key___4 ; { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp & 1) { batadv_debug_log(bat_priv, "Creating new originator: %pM\n", addr); } else { } tmp___0 = kzalloc(1616UL, 32U); orig_node = (struct batadv_orig_node *)tmp___0; if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return ((struct batadv_orig_node *)0); } else { } orig_node->neigh_list.first = (struct hlist_node *)0; INIT_LIST_HEAD(& orig_node->vlan_list); orig_node->ifinfo_list.first = (struct hlist_node *)0; spinlock_check(& orig_node->bcast_seqno_lock); __raw_spin_lock_init(& orig_node->bcast_seqno_lock.ldv_6347.rlock, "&(&orig_node->bcast_seqno_lock)->rlock", & __key); spinlock_check(& orig_node->neigh_list_lock); __raw_spin_lock_init(& orig_node->neigh_list_lock.ldv_6347.rlock, "&(&orig_node->neigh_list_lock)->rlock", & __key___0); spinlock_check(& orig_node->tt_buff_lock); __raw_spin_lock_init(& orig_node->tt_buff_lock.ldv_6347.rlock, "&(&orig_node->tt_buff_lock)->rlock", & __key___1); spinlock_check(& orig_node->tt_lock); __raw_spin_lock_init(& orig_node->tt_lock.ldv_6347.rlock, "&(&orig_node->tt_lock)->rlock", & __key___2); spinlock_check(& orig_node->vlan_list_lock); __raw_spin_lock_init(& orig_node->vlan_list_lock.ldv_6347.rlock, "&(&orig_node->vlan_list_lock)->rlock", & __key___3); batadv_nc_init_orig(orig_node); atomic_set(& orig_node->refcount, 2); orig_node->bat_priv = bat_priv; ether_addr_copy((u8 *)(& orig_node->orig), addr); batadv_dat_init_orig_node_addr(orig_node); atomic_set(& orig_node->last_ttvn, 0); orig_node->tt_buff = (unsigned char *)0U; orig_node->tt_buff_len = 0; tmp___1 = msecs_to_jiffies(30000U); reset_time = ((unsigned long )jiffies - tmp___1) - 1UL; orig_node->bcast_seqno_reset = reset_time; orig_node->mcast_flags = 0U; vlan = batadv_orig_node_vlan_new(orig_node, 0); if ((unsigned long )vlan == (unsigned long )((struct batadv_orig_node_vlan *)0)) { goto free_orig_node; } else { } batadv_orig_node_vlan_free_ref(vlan); i = 0; goto ldv_50228; ldv_50227: orig_node->fragments[i].head.first = (struct hlist_node *)0; spinlock_check(& orig_node->fragments[i].lock); __raw_spin_lock_init(& orig_node->fragments[i].lock.ldv_6347.rlock, "&(&orig_node->fragments[i].lock)->rlock", & __key___4); orig_node->fragments[i].size = 0U; i = i + 1; ldv_50228: ; if (i <= 7) { goto ldv_50227; } else { } return (orig_node); free_orig_node: kfree((void const *)orig_node); return ((struct batadv_orig_node *)0); } } static void batadv_purge_neigh_ifinfo(struct batadv_priv *bat_priv , struct batadv_neigh_node *neigh ) { struct batadv_neigh_ifinfo *neigh_ifinfo ; struct batadv_hard_iface *if_outgoing ; struct hlist_node *node_tmp ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_neigh_ifinfo *tmp ; int tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_ifinfo *tmp___1 ; { spin_lock_bh(& neigh->ifinfo_lock); ____ptr = neigh->ifinfo_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_neigh_ifinfo *)__mptr; } else { tmp = (struct batadv_neigh_ifinfo *)0; } neigh_ifinfo = tmp; goto ldv_50248; ldv_50247: if_outgoing = neigh_ifinfo->if_outgoing; if ((unsigned long )if_outgoing == (unsigned long )((struct batadv_hard_iface *)0)) { goto ldv_50246; } else { } if (((int )((signed char )if_outgoing->if_status) != 2 && (int )((signed char )if_outgoing->if_status) != 0) && (int )((signed char )if_outgoing->if_status) != 1) { goto ldv_50246; } else { } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___0 & 1) { batadv_debug_log(bat_priv, "neighbor/ifinfo purge: neighbor %pM, iface: %s\n", (uint8_t *)(& neigh->addr), (char *)(& (if_outgoing->net_dev)->name)); } else { } hlist_del_rcu(& neigh_ifinfo->list); batadv_neigh_ifinfo_free_ref(neigh_ifinfo); ldv_50246: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_neigh_ifinfo *)__mptr___0; } else { tmp___1 = (struct batadv_neigh_ifinfo *)0; } neigh_ifinfo = tmp___1; ldv_50248: ; if ((unsigned long )neigh_ifinfo != (unsigned long )((struct batadv_neigh_ifinfo *)0)) { node_tmp = neigh_ifinfo->list.next; goto ldv_50247; } else { } spin_unlock_bh(& neigh->ifinfo_lock); return; } } static bool batadv_purge_orig_ifinfo(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct batadv_orig_ifinfo *orig_ifinfo ; struct batadv_hard_iface *if_outgoing ; struct hlist_node *node_tmp ; bool ifinfo_purged ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_orig_ifinfo *tmp ; int tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_ifinfo *tmp___1 ; { ifinfo_purged = 0; spin_lock_bh(& orig_node->neigh_list_lock); ____ptr = orig_node->ifinfo_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_orig_ifinfo *)__mptr; } else { tmp = (struct batadv_orig_ifinfo *)0; } orig_ifinfo = tmp; goto ldv_50269; ldv_50268: if_outgoing = orig_ifinfo->if_outgoing; if ((unsigned long )if_outgoing == (unsigned long )((struct batadv_hard_iface *)0)) { goto ldv_50267; } else { } if (((int )((signed char )if_outgoing->if_status) != 2 && (int )((signed char )if_outgoing->if_status) != 0) && (int )((signed char )if_outgoing->if_status) != 1) { goto ldv_50267; } else { } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___0 & 1) { batadv_debug_log(bat_priv, "router/ifinfo purge: originator %pM, iface: %s\n", (uint8_t *)(& orig_node->orig), (char *)(& (if_outgoing->net_dev)->name)); } else { } ifinfo_purged = 1; hlist_del_rcu(& orig_ifinfo->list); batadv_orig_ifinfo_free_ref(orig_ifinfo); if ((unsigned long )orig_node->last_bonding_candidate == (unsigned long )orig_ifinfo) { orig_node->last_bonding_candidate = (struct batadv_orig_ifinfo *)0; batadv_orig_ifinfo_free_ref(orig_ifinfo); } else { } ldv_50267: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_orig_ifinfo *)__mptr___0; } else { tmp___1 = (struct batadv_orig_ifinfo *)0; } orig_ifinfo = tmp___1; ldv_50269: ; if ((unsigned long )orig_ifinfo != (unsigned long )((struct batadv_orig_ifinfo *)0)) { node_tmp = orig_ifinfo->list.next; goto ldv_50268; } else { } spin_unlock_bh(& orig_node->neigh_list_lock); return (ifinfo_purged); } } static bool batadv_purge_orig_neighbors(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct hlist_node *node_tmp ; struct batadv_neigh_node *neigh_node ; bool neigh_purged ; unsigned long last_seen ; struct batadv_hard_iface *if_incoming ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_neigh_node *tmp ; int tmp___0 ; unsigned int tmp___1 ; int tmp___2 ; bool tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp___4 ; { neigh_purged = 0; spin_lock_bh(& orig_node->neigh_list_lock); ____ptr = orig_node->neigh_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_neigh_node *)__mptr; } else { tmp = (struct batadv_neigh_node *)0; } neigh_node = tmp; goto ldv_50290; ldv_50289: last_seen = neigh_node->last_seen; if_incoming = neigh_node->if_incoming; tmp___3 = batadv_has_timed_out(last_seen, 200000U); if ((((int )tmp___3 || (int )((signed char )if_incoming->if_status) == 2) || (int )((signed char )if_incoming->if_status) == 0) || (int )((signed char )if_incoming->if_status) == 1) { if (((int )((signed char )if_incoming->if_status) == 2 || (int )((signed char )if_incoming->if_status) == 0) || (int )((signed char )if_incoming->if_status) == 1) { tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___0 & 1) { batadv_debug_log(bat_priv, "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n", (uint8_t *)(& orig_node->orig), (uint8_t *)(& neigh_node->addr), (char *)(& (if_incoming->net_dev)->name)); } else { } } else { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___2 & 1) { tmp___1 = jiffies_to_msecs(last_seen); batadv_debug_log(bat_priv, "neighbor timeout: originator %pM, neighbor: %pM, last_seen: %u\n", (uint8_t *)(& orig_node->orig), (uint8_t *)(& neigh_node->addr), tmp___1); } else { } } neigh_purged = 1; hlist_del_rcu(& neigh_node->list); batadv_neigh_node_free_ref(neigh_node); } else { batadv_purge_neigh_ifinfo(bat_priv, neigh_node); } ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_neigh_node *)__mptr___0; } else { tmp___4 = (struct batadv_neigh_node *)0; } neigh_node = tmp___4; ldv_50290: ; if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { node_tmp = neigh_node->list.next; goto ldv_50289; } else { } spin_unlock_bh(& orig_node->neigh_list_lock); return (neigh_purged); } } static struct batadv_neigh_node *batadv_find_best_neighbor(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_hard_iface *if_outgoing ) { struct batadv_neigh_node *best ; struct batadv_neigh_node *neigh ; struct batadv_algo_ops *bao ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_neigh_node *tmp___0 ; int tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_neigh_node *tmp___4 ; { best = (struct batadv_neigh_node *)0; bao = bat_priv->bat_algo_ops; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& orig_node->neigh_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_neigh_node *)__mptr; } else { tmp___0 = (struct batadv_neigh_node *)0; } neigh = tmp___0; goto ldv_50322; ldv_50321: ; if ((unsigned long )best != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___1 = (*(bao->bat_neigh_cmp))(neigh, if_outgoing, best, if_outgoing); if (tmp___1 <= 0) { goto ldv_50320; } else { } } else { } tmp___2 = atomic_add_unless(& neigh->refcount, 1, 0); if (tmp___2 == 0) { goto ldv_50320; } else { } if ((unsigned long )best != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(best); } else { } best = neigh; ldv_50320: _________p1___0 = *((struct hlist_node * volatile *)(& neigh->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_neigh_node *)__mptr___0; } else { tmp___4 = (struct batadv_neigh_node *)0; } neigh = tmp___4; ldv_50322: ; if ((unsigned long )neigh != (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50321; } else { } rcu_read_unlock(); return (best); } } static bool batadv_purge_orig_node(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct batadv_neigh_node *best_neigh_node ; struct batadv_hard_iface *hard_iface ; bool changed_ifinfo ; bool changed_neigh ; unsigned int tmp ; int tmp___0 ; bool tmp___1 ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp___2 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___3 ; { tmp___1 = batadv_has_timed_out(orig_node->last_seen, 400000U); if ((int )tmp___1) { tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___0 & 1) { tmp = jiffies_to_msecs(orig_node->last_seen); batadv_debug_log(bat_priv, "Originator timeout: originator %pM, last_seen %u\n", (uint8_t *)(& orig_node->orig), tmp); } else { } return (1); } else { } changed_ifinfo = batadv_purge_orig_ifinfo(bat_priv, orig_node); changed_neigh = batadv_purge_orig_neighbors(bat_priv, orig_node); if (! changed_ifinfo && ! changed_neigh) { return (0); } else { } best_neigh_node = batadv_find_best_neighbor(bat_priv, orig_node, (struct batadv_hard_iface *)0); batadv_update_route(bat_priv, orig_node, (struct batadv_hard_iface *)0, best_neigh_node); if ((unsigned long )best_neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(best_neigh_node); } else { } rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface *)__mptr; goto ldv_50348; ldv_50347: ; if ((int )((signed char )hard_iface->if_status) != 3) { goto ldv_50346; } else { } if ((unsigned long )hard_iface->soft_iface != (unsigned long )bat_priv->soft_iface) { goto ldv_50346; } else { } best_neigh_node = batadv_find_best_neighbor(bat_priv, orig_node, hard_iface); batadv_update_route(bat_priv, orig_node, hard_iface, best_neigh_node); if ((unsigned long )best_neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(best_neigh_node); } else { } ldv_50346: __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface *)__mptr___0; ldv_50348: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50347; } else { } rcu_read_unlock(); return (0); } } static void _batadv_purge_orig(struct batadv_priv *bat_priv ) { struct batadv_hashtable *hash ; struct hlist_node *node_tmp ; struct hlist_head *head ; spinlock_t *list_lock ; struct batadv_orig_node *orig_node ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp ; bool tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___1 ; { hash = bat_priv->orig_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0U; goto ldv_50373; ldv_50372: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp = (struct batadv_orig_node *)0; } orig_node = tmp; goto ldv_50370; ldv_50369: tmp___0 = batadv_purge_orig_node(bat_priv, orig_node); if ((int )tmp___0) { batadv_gw_node_delete(bat_priv, orig_node); hlist_del_rcu(& orig_node->hash_entry); batadv_orig_node_free_ref(orig_node); goto ldv_50368; } else { } batadv_frag_purge_orig(orig_node, & batadv_frag_check_entry); ldv_50368: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; ldv_50370: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { node_tmp = orig_node->hash_entry.next; goto ldv_50369; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_50373: ; if (hash->size > i) { goto ldv_50372; } else { } batadv_gw_node_purge(bat_priv); batadv_gw_election(bat_priv); return; } } static void batadv_purge_orig(struct work_struct *work ) { struct delayed_work *delayed_work ; struct batadv_priv *bat_priv ; struct work_struct const *__mptr ; struct delayed_work const *__mptr___0 ; unsigned long tmp ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; bat_priv = (struct batadv_priv *)__mptr___0 + 0xfffffffffffffe28UL; _batadv_purge_orig(bat_priv); tmp = msecs_to_jiffies(1000U); queue_delayed_work(batadv_event_workqueue, & bat_priv->orig_work, tmp); return; } } void batadv_purge_orig_ref(struct batadv_priv *bat_priv ) { { _batadv_purge_orig(bat_priv); return; } } int batadv_orig_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hard_iface *primary_if ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { return (0); } else { } seq_printf(seq, "[B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s %s)]\n", (char *)"2014.3.0", (char *)(& (primary_if->net_dev)->name), (primary_if->net_dev)->dev_addr, (char *)(& net_dev->name), (bat_priv->bat_algo_ops)->name); batadv_hardif_free_ref(primary_if); if ((unsigned long )(bat_priv->bat_algo_ops)->bat_orig_print == (unsigned long )((void (*)(struct batadv_priv * , struct seq_file * , struct batadv_hard_iface * ))0)) { seq_puts(seq, "No printing function for this routing protocol\n"); return (0); } else { } (*((bat_priv->bat_algo_ops)->bat_orig_print))(bat_priv, seq, (struct batadv_hard_iface *)0); return (0); } } int batadv_orig_hardif_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_hard_iface *hard_iface ; struct batadv_priv *bat_priv ; void *tmp ; { net_dev = (struct net_device *)seq->private; hard_iface = batadv_hardif_get_by_netdev((struct net_device const *)net_dev); if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0) || (unsigned long )hard_iface->soft_iface == (unsigned long )((struct net_device *)0)) { seq_puts(seq, "Interface not known to B.A.T.M.A.N.\n"); goto out; } else { } tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; if ((unsigned long )(bat_priv->bat_algo_ops)->bat_orig_print == (unsigned long )((void (*)(struct batadv_priv * , struct seq_file * , struct batadv_hard_iface * ))0)) { seq_puts(seq, "No printing function for this routing protocol\n"); goto out; } else { } if ((int )((signed char )hard_iface->if_status) != 3) { seq_puts(seq, "Interface not active\n"); goto out; } else { } seq_printf(seq, "[B.A.T.M.A.N. adv %s, IF/MAC: %s/%pM (%s %s)]\n", (char *)"2014.3.0", (char *)(& (hard_iface->net_dev)->name), (hard_iface->net_dev)->dev_addr, (char *)(& (hard_iface->soft_iface)->name), (bat_priv->bat_algo_ops)->name); (*((bat_priv->bat_algo_ops)->bat_orig_print))(bat_priv, seq, hard_iface); out: ; if ((unsigned long )hard_iface != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(hard_iface); } else { } return (0); } } int batadv_orig_hash_add_if(struct batadv_hard_iface *hard_iface , int max_if_num ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_algo_ops *bao ; struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; uint32_t i ; int ret ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___3 ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; bao = bat_priv->bat_algo_ops; hash = bat_priv->orig_hash; i = 0U; goto ldv_50438; ldv_50437: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_50435; ldv_50434: ret = 0; if ((unsigned long )bao->bat_orig_add_if != (unsigned long )((int (*)(struct batadv_orig_node * , int ))0)) { ret = (*(bao->bat_orig_add_if))(orig_node, max_if_num); } else { } if (ret == -12) { goto err; } else { } _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___3 = (struct batadv_orig_node *)0; } orig_node = tmp___3; ldv_50435: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_50434; } else { } rcu_read_unlock(); i = i + 1U; ldv_50438: ; if (hash->size > i) { goto ldv_50437; } else { } return (0); err: rcu_read_unlock(); return (-12); } } int batadv_orig_hash_del_if(struct batadv_hard_iface *hard_iface , int max_if_num ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_hard_iface *hard_iface_tmp ; struct batadv_orig_node *orig_node ; struct batadv_algo_ops *bao ; uint32_t i ; int ret ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___3 ; struct list_head *__ptr ; struct list_head const *__mptr___1 ; struct list_head *_________p1___1 ; bool __warned___1 ; int tmp___4 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___2 ; struct list_head *_________p1___2 ; bool __warned___2 ; int tmp___5 ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->orig_hash; bao = bat_priv->bat_algo_ops; i = 0U; goto ldv_50477; ldv_50476: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_50474; ldv_50473: ret = 0; if ((unsigned long )bao->bat_orig_del_if != (unsigned long )((int (*)(struct batadv_orig_node * , int , int ))0)) { ret = (*(bao->bat_orig_del_if))(orig_node, max_if_num, (int )hard_iface->if_num); } else { } if (ret == -12) { goto err; } else { } _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___3 = (struct batadv_orig_node *)0; } orig_node = tmp___3; ldv_50474: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_50473; } else { } rcu_read_unlock(); i = i + 1U; ldv_50477: ; if (hash->size > i) { goto ldv_50476; } else { } rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1___1 = *((struct list_head * volatile *)(& __ptr)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___1) { rcu_read_lock_held(); } else { } __mptr___1 = (struct list_head const *)_________p1___1; hard_iface_tmp = (struct batadv_hard_iface *)__mptr___1; goto ldv_50495; ldv_50494: ; if ((int )((signed char )hard_iface_tmp->if_status) == 0) { goto ldv_50493; } else { } if ((unsigned long )hard_iface == (unsigned long )hard_iface_tmp) { goto ldv_50493; } else { } if ((unsigned long )hard_iface->soft_iface != (unsigned long )hard_iface_tmp->soft_iface) { goto ldv_50493; } else { } if ((int )hard_iface_tmp->if_num > (int )hard_iface->if_num) { hard_iface_tmp->if_num = (int16_t )((int )hard_iface_tmp->if_num - 1); } else { } ldv_50493: __ptr___0 = hard_iface_tmp->list.next; _________p1___2 = *((struct list_head * volatile *)(& __ptr___0)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___2) { rcu_read_lock_held(); } else { } __mptr___2 = (struct list_head const *)_________p1___2; hard_iface_tmp = (struct batadv_hard_iface *)__mptr___2; ldv_50495: ; if ((unsigned long )(& hard_iface_tmp->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50494; } else { } rcu_read_unlock(); hard_iface->if_num = -1; return (0); err: rcu_read_unlock(); return (-12); } } void *ldv_kmem_cache_alloc_598(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_604(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_606(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_608(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_609(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_610(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_611(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_612(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_613(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_614(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_615(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } extern int __dynamic_pr_debug(struct _ddebug * , char const * , ...) ; __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_642(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_659(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_650(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_658(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_652(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_648(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_656(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_657(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_653(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_654(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_655(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static int __skb_cow___2(struct sk_buff *skb , unsigned int headroom , int cloned ) { int delta ; unsigned int tmp ; unsigned int tmp___0 ; int _max1 ; int _max2 ; int _max1___0 ; int _max2___0 ; int tmp___1 ; { delta = 0; tmp___0 = skb_headroom((struct sk_buff const *)skb); if (tmp___0 < headroom) { tmp = skb_headroom((struct sk_buff const *)skb); delta = (int )(headroom - tmp); } else { } if (delta != 0 || cloned != 0) { _max1 = 32; _max2 = 64; _max1___0 = 32; _max2___0 = 64; tmp___1 = ldv_pskb_expand_head_656(skb, (((_max1 > _max2 ? _max1 : _max2) + -1) + delta) & - (_max1___0 > _max2___0 ? _max1___0 : _max2___0), 0, 32U); return (tmp___1); } else { } return (0); } } __inline static int skb_cow___0(struct sk_buff *skb , unsigned int headroom ) { int tmp ; int tmp___0 ; { tmp = skb_cloned((struct sk_buff const *)skb); tmp___0 = __skb_cow___2(skb, headroom, tmp); return (tmp___0); } } __inline static bool is_broadcast_ether_addr(u8 const *addr ) { { return ((unsigned int )(((int )((unsigned short )*((u16 const *)addr)) & (int )((unsigned short )*((u16 const *)addr + 2U))) & (int )((unsigned short )*((u16 const *)addr + 4U))) == 65535U); } } int batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv , struct sk_buff const *skb , unsigned long delay ) ; void batadv_interface_rx(struct net_device *soft_iface , struct sk_buff *skb , struct batadv_hard_iface *recv_if , int hdr_size , struct batadv_orig_node *orig_node ) ; bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv , uint8_t *addr , unsigned short vid ) ; __inline static uint32_t batadv_choose_orig___7(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49749; ldv_49748: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49749: ; if (i <= 5UL) { goto ldv_49748; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find___5(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig___7(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_49783; ldv_49782: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_49780; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49780; } else { } orig_node_tmp = orig_node; goto ldv_49781; ldv_49780: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_49783: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49782; } else { } ldv_49781: rcu_read_unlock(); return (orig_node_tmp); } } __inline static void batadv_dat_inc_counter(struct batadv_priv *bat_priv , uint8_t subtype ) { { switch ((int )subtype) { case 2: batadv_add_counter___0(bat_priv, 24UL, 1UL); goto ldv_49858; case 3: batadv_add_counter___0(bat_priv, 26UL, 1UL); goto ldv_49858; } ldv_49858: ; return; } } static int batadv_route_unicast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) ; extern void __compiletime_assert_247(void) ; static void _batadv_update_route(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_hard_iface *recv_if , struct batadv_neigh_node *neigh_node ) { struct batadv_orig_ifinfo *orig_ifinfo ; struct batadv_neigh_node *curr_router ; struct batadv_neigh_node *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; bool __cond ; { orig_ifinfo = batadv_orig_ifinfo_get(orig_node, recv_if); if ((unsigned long )orig_ifinfo == (unsigned long )((struct batadv_orig_ifinfo *)0)) { return; } else { } rcu_read_lock(); _________p1 = *((struct batadv_neigh_node * volatile *)(& orig_ifinfo->router)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { tmp___0 = rcu_read_lock_held(); if (tmp___0 == 0 && 1) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/routing.o.c.prepared", 214, "suspicious rcu_dereference_check() usage"); } else { } } else { } curr_router = _________p1; if ((unsigned long )curr_router != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___1 = atomic_add_unless(& curr_router->refcount, 1, 0); if (tmp___1 == 0) { curr_router = (struct batadv_neigh_node *)0; } else { } } else { } rcu_read_unlock(); if ((unsigned long )curr_router != (unsigned long )((struct batadv_neigh_node *)0) && (unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 2) != 0) { batadv_debug_log(bat_priv, "Deleting route towards: %pM\n", (uint8_t *)(& orig_node->orig)); } else { } batadv_tt_global_del_orig(bat_priv, orig_node, -1, "Deleted route towards originator"); } else if ((unsigned long )curr_router == (unsigned long )((struct batadv_neigh_node *)0) && (unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___3 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___3 & 2) != 0) { batadv_debug_log(bat_priv, "Adding route towards: %pM (via %pM)\n", (uint8_t *)(& orig_node->orig), (uint8_t *)(& neigh_node->addr)); } else { } } else if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0) && (unsigned long )curr_router != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___4 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___4 & 2) != 0) { batadv_debug_log(bat_priv, "Changing route towards: %pM (now via %pM - was via %pM)\n", (uint8_t *)(& orig_node->orig), (uint8_t *)(& neigh_node->addr), (uint8_t *)(& curr_router->addr)); } else { } } else { } if ((unsigned long )curr_router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(curr_router); } else { } if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___5 = atomic_add_unless(& neigh_node->refcount, 1, 0); if (tmp___5 == 0) { neigh_node = (struct batadv_neigh_node *)0; } else { } } else { } spin_lock_bh(& orig_node->neigh_list_lock); __cond = 0; if ((int )__cond) { __compiletime_assert_247(); } else { } __asm__ volatile ("": : : "memory"); *((struct batadv_neigh_node * volatile *)(& orig_ifinfo->router)) = neigh_node; spin_unlock_bh(& orig_node->neigh_list_lock); batadv_orig_ifinfo_free_ref(orig_ifinfo); if ((unsigned long )curr_router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(curr_router); } else { } return; } } void batadv_update_route(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_hard_iface *recv_if , struct batadv_neigh_node *neigh_node ) { struct batadv_neigh_node *router ; { router = (struct batadv_neigh_node *)0; if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } router = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)recv_if); if ((unsigned long )router != (unsigned long )neigh_node) { _batadv_update_route(bat_priv, orig_node, recv_if, neigh_node); } else { } out: ; if ((unsigned long )router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(router); } else { } return; } } int batadv_window_protected(struct batadv_priv *bat_priv , int32_t seq_num_diff , unsigned long *last_reset ) { bool tmp ; int tmp___0 ; int tmp___1 ; { if (seq_num_diff < -63 || seq_num_diff > 65535) { tmp = batadv_has_timed_out(*last_reset, 30000U); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { return (1); } else { } *last_reset = jiffies; tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___1 & 1) { batadv_debug_log(bat_priv, "old packet received, start protection\n"); } else { } } else { } return (0); } } bool batadv_check_management_packet(struct sk_buff *skb , struct batadv_hard_iface *hard_iface , int header_len ) { struct ethhdr *ethhdr ; int tmp ; long tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; int tmp___5 ; { tmp = pskb_may_pull(skb, (unsigned int )header_len); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { return (0); } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___1 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_dest)); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { return (0); } else { } tmp___3 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_source)); if ((int )tmp___3) { return (0); } else { } tmp___4 = skb_cow___0(skb, 0U); if (tmp___4 < 0) { return (0); } else { } tmp___5 = skb_linearize(skb); if (tmp___5 < 0) { return (0); } else { } return (1); } } static int batadv_recv_my_icmp_packet(struct batadv_priv *bat_priv , struct sk_buff *skb ) { struct batadv_hard_iface *primary_if ; struct batadv_orig_node *orig_node ; struct batadv_icmp_header *icmph ; int res ; int ret ; int tmp ; int tmp___0 ; { primary_if = (struct batadv_hard_iface *)0; orig_node = (struct batadv_orig_node *)0; ret = 1; icmph = (struct batadv_icmp_header *)skb->data; switch ((int )icmph->msg_type) { case 0: ; case 3: ; case 11: tmp = skb_linearize(skb); if (tmp < 0) { goto ldv_49965; } else { } batadv_socket_receive_packet(icmph, (size_t )skb->len); goto ldv_49965; case 8: primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } orig_node = batadv_orig_hash_find___5(bat_priv, (void const *)(& icmph->orig)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tmp___0 = skb_cow___0(skb, 14U); if (tmp___0 < 0) { goto out; } else { } icmph = (struct batadv_icmp_header *)skb->data; ether_addr_copy((u8 *)(& icmph->dst), (u8 const *)(& icmph->orig)); ether_addr_copy((u8 *)(& icmph->orig), (u8 const *)(primary_if->net_dev)->dev_addr); icmph->msg_type = 0U; icmph->ttl = 50U; res = batadv_send_skb_to_orig(skb, orig_node, (struct batadv_hard_iface *)0); if (res != 1) { ret = 0; } else { } goto ldv_49965; default: ; goto out; } ldv_49965: ; out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (ret); } } static int batadv_recv_icmp_ttl_exceeded(struct batadv_priv *bat_priv , struct sk_buff *skb ) { struct batadv_hard_iface *primary_if ; struct batadv_orig_node *orig_node ; struct batadv_icmp_packet *icmp_packet ; int ret ; struct _ddebug descriptor ; long tmp ; int tmp___0 ; int tmp___1 ; { primary_if = (struct batadv_hard_iface *)0; orig_node = (struct batadv_orig_node *)0; ret = 1; icmp_packet = (struct batadv_icmp_packet *)skb->data; if ((unsigned int )icmp_packet->msg_type != 8U) { descriptor.modname = "batman_adv"; descriptor.function = "batadv_recv_icmp_ttl_exceeded"; descriptor.filename = "/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/routing.o.c.prepared"; descriptor.format = "Warning - can\'t forward icmp packet from %pM to %pM: ttl exceeded\n"; descriptor.lineno = 416U; descriptor.flags = 0U; tmp = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp != 0L) { __dynamic_pr_debug(& descriptor, "batman_adv: Warning - can\'t forward icmp packet from %pM to %pM: ttl exceeded\n", (uint8_t *)(& icmp_packet->orig), (uint8_t *)(& icmp_packet->dst)); } else { } goto out; } else { } primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } orig_node = batadv_orig_hash_find___5(bat_priv, (void const *)(& icmp_packet->orig)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tmp___0 = skb_cow___0(skb, 14U); if (tmp___0 < 0) { goto out; } else { } icmp_packet = (struct batadv_icmp_packet *)skb->data; ether_addr_copy((u8 *)(& icmp_packet->dst), (u8 const *)(& icmp_packet->orig)); ether_addr_copy((u8 *)(& icmp_packet->orig), (u8 const *)(primary_if->net_dev)->dev_addr); icmp_packet->msg_type = 11U; icmp_packet->ttl = 50U; tmp___1 = batadv_send_skb_to_orig(skb, orig_node, (struct batadv_hard_iface *)0); if (tmp___1 != 1) { ret = 0; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (ret); } } int batadv_recv_icmp_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_icmp_header *icmph ; struct batadv_icmp_packet_rr *icmp_packet_rr ; struct ethhdr *ethhdr ; struct batadv_orig_node *orig_node ; int hdr_size ; int ret ; int tmp___0 ; long tmp___1 ; bool tmp___2 ; bool tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; orig_node = (struct batadv_orig_node *)0; hdr_size = 20; ret = 1; tmp___0 = pskb_may_pull(skb, (unsigned int )hdr_size); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { goto out; } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___2 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___2) { goto out; } else { } tmp___3 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_source)); if ((int )tmp___3) { goto out; } else { } tmp___4 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& ethhdr->h_dest)); if (tmp___4 == 0) { goto out; } else { } icmph = (struct batadv_icmp_header *)skb->data; if (((unsigned int )icmph->msg_type == 0U || (unsigned int )icmph->msg_type == 8U) && skb->len > 115U) { tmp___5 = skb_linearize(skb); if (tmp___5 < 0) { goto out; } else { } tmp___6 = skb_cow___0(skb, 14U); if (tmp___6 < 0) { goto out; } else { } icmph = (struct batadv_icmp_header *)skb->data; icmp_packet_rr = (struct batadv_icmp_packet_rr *)icmph; if ((unsigned int )icmp_packet_rr->rr_cur > 15U) { goto out; } else { } ether_addr_copy((u8 *)(& icmp_packet_rr->rr) + (unsigned long )icmp_packet_rr->rr_cur, (u8 const *)(& ethhdr->h_dest)); icmp_packet_rr->rr_cur = (uint8_t )((int )icmp_packet_rr->rr_cur + 1); } else { } tmp___8 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& icmph->dst)); if (tmp___8 != 0) { tmp___7 = batadv_recv_my_icmp_packet(bat_priv, skb); return (tmp___7); } else { } if ((unsigned int )icmph->ttl <= 1U) { tmp___9 = batadv_recv_icmp_ttl_exceeded(bat_priv, skb); return (tmp___9); } else { } orig_node = batadv_orig_hash_find___5(bat_priv, (void const *)(& icmph->dst)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tmp___10 = skb_cow___0(skb, 14U); if (tmp___10 < 0) { goto out; } else { } icmph = (struct batadv_icmp_header *)skb->data; icmph->ttl = (uint8_t )((int )icmph->ttl - 1); tmp___11 = batadv_send_skb_to_orig(skb, orig_node, recv_if); if (tmp___11 != 1) { ret = 0; } else { } out: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (ret); } } static int batadv_check_unicast_packet(struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_size ) { struct ethhdr *ethhdr ; int tmp ; long tmp___0 ; bool tmp___1 ; bool tmp___2 ; int tmp___3 ; { tmp = pskb_may_pull(skb, (unsigned int )hdr_size); tmp___0 = ldv__builtin_expect(tmp == 0, 0L); if (tmp___0 != 0L) { return (-61); } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___1 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___1) { return (-53); } else { } tmp___2 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_source)); if ((int )tmp___2) { return (-53); } else { } tmp___3 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& ethhdr->h_dest)); if (tmp___3 == 0) { return (-66); } else { } return (0); } } struct batadv_neigh_node *batadv_find_router(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_hard_iface *recv_if ) { struct batadv_algo_ops *bao ; struct batadv_neigh_node *first_candidate_router ; struct batadv_neigh_node *next_candidate_router ; struct batadv_neigh_node *router ; struct batadv_neigh_node *cand_router ; struct batadv_neigh_node *last_cand_router ; struct batadv_orig_ifinfo *cand ; struct batadv_orig_ifinfo *first_candidate ; struct batadv_orig_ifinfo *next_candidate ; struct batadv_orig_ifinfo *last_candidate ; bool last_candidate_found ; int tmp ; struct batadv_neigh_node *_________p1 ; bool __warned ; int tmp___0 ; int tmp___1 ; struct hlist_node *____ptr ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr ; struct batadv_orig_ifinfo *tmp___3 ; int tmp___4 ; struct batadv_neigh_node *_________p1___1 ; bool __warned___1 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; bool tmp___8 ; int tmp___9 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___2 ; bool __warned___2 ; int tmp___10 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_ifinfo *tmp___11 ; { bao = bat_priv->bat_algo_ops; first_candidate_router = (struct batadv_neigh_node *)0; next_candidate_router = (struct batadv_neigh_node *)0; cand_router = (struct batadv_neigh_node *)0; last_cand_router = (struct batadv_neigh_node *)0; first_candidate = (struct batadv_orig_ifinfo *)0; next_candidate = (struct batadv_orig_ifinfo *)0; last_candidate_found = 0; if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return ((struct batadv_neigh_node *)0); } else { } router = batadv_orig_router_get(orig_node, (struct batadv_hard_iface const *)recv_if); if ((unsigned long )recv_if == (unsigned long )((struct batadv_hard_iface *)0)) { return (router); } else { tmp = atomic_read((atomic_t const *)(& bat_priv->bonding)); if (tmp == 0) { return (router); } else if ((unsigned long )router == (unsigned long )((struct batadv_neigh_node *)0)) { return (router); } else { } } rcu_read_lock(); last_candidate = orig_node->last_bonding_candidate; if ((unsigned long )last_candidate != (unsigned long )((struct batadv_orig_ifinfo *)0)) { _________p1 = *((struct batadv_neigh_node * volatile *)(& last_candidate->router)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { tmp___1 = rcu_read_lock_held(); if (tmp___1 == 0 && 1) { __warned = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/routing.o.c.prepared", 620, "suspicious rcu_dereference_check() usage"); } else { } } else { } last_cand_router = _________p1; } else { } _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->ifinfo_list.first)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr = _________p1___0; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___3 = (struct batadv_orig_ifinfo *)__mptr; } else { tmp___3 = (struct batadv_orig_ifinfo *)0; } cand = tmp___3; goto ldv_50044; ldv_50043: tmp___4 = atomic_add_unless(& cand->refcount, 1, 0); if (tmp___4 == 0) { goto ldv_50037; } else { } _________p1___1 = *((struct batadv_neigh_node * volatile *)(& cand->router)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___1) { tmp___6 = rcu_read_lock_held(); if (tmp___6 == 0 && 1) { __warned___1 = 1; lockdep_rcu_suspicious("/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/routing.o.c.prepared", 627, "suspicious rcu_dereference_check() usage"); } else { } } else { } cand_router = _________p1___1; if ((unsigned long )cand_router == (unsigned long )((struct batadv_neigh_node *)0)) { goto next; } else { } tmp___7 = atomic_add_unless(& cand_router->refcount, 1, 0); if (tmp___7 == 0) { cand_router = (struct batadv_neigh_node *)0; goto next; } else { } tmp___8 = (*(bao->bat_neigh_is_equiv_or_better))(cand_router, cand->if_outgoing, router, recv_if); if (tmp___8) { tmp___9 = 0; } else { tmp___9 = 1; } if (tmp___9) { goto next; } else { } if ((unsigned long )last_cand_router == (unsigned long )cand_router) { goto next; } else { } if ((unsigned long )first_candidate == (unsigned long )((struct batadv_orig_ifinfo *)0)) { atomic_inc(& cand_router->refcount); atomic_inc(& cand->refcount); first_candidate = cand; first_candidate_router = cand_router; } else { } if ((unsigned long )last_candidate == (unsigned long )((struct batadv_orig_ifinfo *)0) || (int )last_candidate_found) { next_candidate = cand; next_candidate_router = cand_router; goto ldv_50042; } else { } if ((unsigned long )last_candidate == (unsigned long )cand) { last_candidate_found = 1; } else { } next: ; if ((unsigned long )cand_router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(cand_router); cand_router = (struct batadv_neigh_node *)0; } else { } batadv_orig_ifinfo_free_ref(cand); ldv_50037: _________p1___2 = *((struct hlist_node * volatile *)(& cand->list.next)); tmp___10 = debug_lockdep_rcu_enabled(); if (tmp___10 != 0 && ! __warned___2) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___2; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___11 = (struct batadv_orig_ifinfo *)__mptr___0; } else { tmp___11 = (struct batadv_orig_ifinfo *)0; } cand = tmp___11; ldv_50044: ; if ((unsigned long )cand != (unsigned long )((struct batadv_orig_ifinfo *)0)) { goto ldv_50043; } else { } ldv_50042: rcu_read_unlock(); if ((unsigned long )orig_node->last_bonding_candidate != (unsigned long )((struct batadv_orig_ifinfo *)0)) { batadv_orig_ifinfo_free_ref(orig_node->last_bonding_candidate); } else { } if ((unsigned long )next_candidate != (unsigned long )((struct batadv_orig_ifinfo *)0)) { batadv_neigh_node_free_ref(router); if ((unsigned long )first_candidate != (unsigned long )((struct batadv_orig_ifinfo *)0)) { batadv_neigh_node_free_ref(first_candidate_router); batadv_orig_ifinfo_free_ref(first_candidate); } else { } router = next_candidate_router; orig_node->last_bonding_candidate = next_candidate; } else if ((unsigned long )first_candidate != (unsigned long )((struct batadv_orig_ifinfo *)0)) { batadv_neigh_node_free_ref(router); router = first_candidate_router; orig_node->last_bonding_candidate = first_candidate; } else { orig_node->last_bonding_candidate = (struct batadv_orig_ifinfo *)0; } return (router); } } static int batadv_route_unicast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_orig_node *orig_node ; struct batadv_unicast_packet *unicast_packet ; struct ethhdr *ethhdr ; struct ethhdr *tmp___0 ; int res ; int hdr_len ; int ret ; struct _ddebug descriptor ; long tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; orig_node = (struct batadv_orig_node *)0; tmp___0 = eth_hdr((struct sk_buff const *)skb); ethhdr = tmp___0; ret = 1; unicast_packet = (struct batadv_unicast_packet *)skb->data; if ((unsigned int )unicast_packet->ttl <= 1U) { descriptor.modname = "batman_adv"; descriptor.function = "batadv_route_unicast_packet"; descriptor.filename = "/work/ldvuser/mutilin/launch/work/current--X--net--X--defaultlinux-3.16-rc1.tar.xz--X--43_2a--X--cpachecker/linux-3.16-rc1.tar.xz/csd_deg_dscv/797/dscv_tempdir/dscv/ri/43_2a/net/batman-adv/routing.o.c.prepared"; descriptor.format = "Warning - can\'t forward unicast packet from %pM to %pM: ttl exceeded\n"; descriptor.lineno = 724U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { __dynamic_pr_debug(& descriptor, "batman_adv: Warning - can\'t forward unicast packet from %pM to %pM: ttl exceeded\n", (unsigned char *)(& ethhdr->h_source), (uint8_t *)(& unicast_packet->dest)); } else { } goto out; } else { } orig_node = batadv_orig_hash_find___5(bat_priv, (void const *)(& unicast_packet->dest)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tmp___2 = skb_cow___0(skb, 14U); if (tmp___2 < 0) { goto out; } else { } unicast_packet = (struct batadv_unicast_packet *)skb->data; unicast_packet->ttl = (uint8_t )((int )unicast_packet->ttl - 1); switch ((int )unicast_packet->packet_type) { case 66: hdr_len = 18; goto ldv_50060; case 64: hdr_len = 10; goto ldv_50060; default: hdr_len = -1; goto ldv_50060; } ldv_50060: ; if (hdr_len > 0) { batadv_skb_set_priority(skb, hdr_len); } else { } res = batadv_send_skb_to_orig(skb, orig_node, recv_if); if (res == 0) { batadv_add_counter___0(bat_priv, 5UL, 1UL); batadv_add_counter___0(bat_priv, 6UL, (size_t )(skb->len + 14U)); ret = 0; } else if (res == 3) { ret = 0; } else { } out: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (ret); } } static bool batadv_reroute_unicast_packet(struct batadv_priv *bat_priv , struct batadv_unicast_packet *unicast_packet , uint8_t *dst_addr , unsigned short vid ) { struct batadv_orig_node *orig_node ; struct batadv_hard_iface *primary_if ; bool ret ; uint8_t *orig_addr ; uint8_t orig_ttvn ; int tmp ; int tmp___0 ; int tmp___1 ; bool tmp___2 ; { orig_node = (struct batadv_orig_node *)0; primary_if = (struct batadv_hard_iface *)0; ret = 0; tmp___2 = batadv_is_my_client(bat_priv, (uint8_t const *)dst_addr, (int )vid); if ((int )tmp___2) { primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } orig_addr = (primary_if->net_dev)->dev_addr; tmp = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); orig_ttvn = (unsigned char )tmp; } else { orig_node = batadv_transtable_search(bat_priv, (uint8_t const *)0U, (uint8_t const *)dst_addr, (int )vid); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tmp___0 = batadv_compare_eth((void const *)(& orig_node->orig), (void const *)(& unicast_packet->dest)); if (tmp___0 != 0) { goto out; } else { } orig_addr = (uint8_t *)(& orig_node->orig); tmp___1 = atomic_read((atomic_t const *)(& orig_node->last_ttvn)); orig_ttvn = (unsigned char )tmp___1; } ether_addr_copy((u8 *)(& unicast_packet->dest), (u8 const *)orig_addr); unicast_packet->ttvn = orig_ttvn; ret = 1; out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (ret); } } static int batadv_check_unicast_ttvn(struct batadv_priv *bat_priv , struct sk_buff *skb , int hdr_len ) { struct batadv_unicast_packet *unicast_packet ; struct batadv_hard_iface *primary_if ; struct batadv_orig_node *orig_node ; uint8_t curr_ttvn ; uint8_t old_ttvn ; struct ethhdr *ethhdr ; unsigned short vid ; int is_old_ttvn ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; bool tmp___3 ; bool tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; uint8_t _d1 ; uint8_t _d2 ; uint8_t _dummy ; int tmp___8 ; int tmp___9 ; bool tmp___10 ; bool tmp___11 ; int tmp___12 ; { tmp = pskb_may_pull(skb, (unsigned int )(hdr_len + 14)); if (tmp == 0) { return (0); } else { } tmp___0 = skb_cow___0(skb, 10U); if (tmp___0 < 0) { return (0); } else { } unicast_packet = (struct batadv_unicast_packet *)skb->data; vid = batadv_get_vid(skb, (size_t )hdr_len); ethhdr = (struct ethhdr *)skb->data + (unsigned long )hdr_len; tmp___4 = batadv_tt_local_client_is_roaming(bat_priv, (uint8_t *)(& ethhdr->h_dest), (int )vid); if ((int )tmp___4) { tmp___3 = batadv_reroute_unicast_packet(bat_priv, unicast_packet, (uint8_t *)(& ethhdr->h_dest), (int )vid); if ((int )tmp___3) { tmp___2 = net_ratelimit(); if (tmp___2 != 0) { tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 4) != 0) { batadv_debug_log(bat_priv, "Rerouting unicast packet to %pM (dst=%pM): Local Roaming\n", (uint8_t *)(& unicast_packet->dest), (unsigned char *)(& ethhdr->h_dest)); } else { } } else { } } else { } return (1); } else { } tmp___5 = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); curr_ttvn = (unsigned char )tmp___5; tmp___7 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& unicast_packet->dest)); if (tmp___7 == 0) { orig_node = batadv_orig_hash_find___5(bat_priv, (void const *)(& unicast_packet->dest)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { return (0); } else { } tmp___6 = atomic_read((atomic_t const *)(& orig_node->last_ttvn)); curr_ttvn = (unsigned char )tmp___6; batadv_orig_node_free_ref(orig_node); } else { } _d1 = unicast_packet->ttvn; _d2 = curr_ttvn; _dummy = (int )_d1 - (int )_d2; is_old_ttvn = (unsigned int )_dummy > 128U; if (is_old_ttvn == 0) { return (1); } else { } old_ttvn = unicast_packet->ttvn; tmp___10 = batadv_reroute_unicast_packet(bat_priv, unicast_packet, (uint8_t *)(& ethhdr->h_dest), (int )vid); if ((int )tmp___10) { tmp___9 = net_ratelimit(); if (tmp___9 != 0) { tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___8 & 4) != 0) { batadv_debug_log(bat_priv, "Rerouting unicast packet to %pM (dst=%pM): TTVN mismatch old_ttvn=%u new_ttvn=%u\n", (uint8_t *)(& unicast_packet->dest), (unsigned char *)(& ethhdr->h_dest), (int )old_ttvn, (int )curr_ttvn); } else { } } else { } return (1); } else { } tmp___11 = batadv_is_my_client(bat_priv, (uint8_t const *)(& ethhdr->h_dest), (int )vid); if (tmp___11) { tmp___12 = 0; } else { tmp___12 = 1; } if (tmp___12) { return (0); } else { } primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { return (0); } else { } ether_addr_copy((u8 *)(& unicast_packet->dest), (u8 const *)(primary_if->net_dev)->dev_addr); batadv_hardif_free_ref(primary_if); unicast_packet->ttvn = curr_ttvn; return (1); } } int batadv_recv_unhandled_unicast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_unicast_packet *unicast_packet ; struct batadv_priv *bat_priv ; void *tmp ; int check ; int hdr_size ; int tmp___0 ; int tmp___1 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; hdr_size = 10; check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); if (check < 0) { return (1); } else { } unicast_packet = (struct batadv_unicast_packet *)skb->data; tmp___0 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& unicast_packet->dest)); if (tmp___0 != 0) { return (1); } else { } tmp___1 = batadv_route_unicast_packet(skb, recv_if); return (tmp___1); } } int batadv_recv_unicast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_unicast_packet *unicast_packet ; struct batadv_unicast_4addr_packet *unicast_4addr_packet ; uint8_t *orig_addr ; struct batadv_orig_node *orig_node ; int check ; int hdr_size ; bool is4addr ; int tmp___0 ; bool tmp___1 ; bool tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; orig_node = (struct batadv_orig_node *)0; hdr_size = 10; unicast_packet = (struct batadv_unicast_packet *)skb->data; unicast_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data; is4addr = (unsigned int )unicast_packet->packet_type == 66U; if ((int )is4addr) { hdr_size = 18; } else { } check = batadv_check_unicast_packet(bat_priv, skb, hdr_size); if (check == -66) { batadv_nc_skb_store_sniffed_unicast(bat_priv, skb); } else { } if (check < 0) { return (1); } else { } tmp___0 = batadv_check_unicast_ttvn(bat_priv, skb, hdr_size); if (tmp___0 == 0) { return (1); } else { } tmp___3 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& unicast_packet->dest)); if (tmp___3 != 0) { if ((int )is4addr) { batadv_dat_inc_counter(bat_priv, (int )unicast_4addr_packet->subtype); orig_addr = (uint8_t *)(& unicast_4addr_packet->src); orig_node = batadv_orig_hash_find___5(bat_priv, (void const *)orig_addr); } else { } tmp___1 = batadv_dat_snoop_incoming_arp_request(bat_priv, skb, hdr_size); if ((int )tmp___1) { goto rx_success; } else { } tmp___2 = batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size); if ((int )tmp___2) { goto rx_success; } else { } batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size, orig_node); rx_success: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (0); } else { } tmp___4 = batadv_route_unicast_packet(skb, recv_if); return (tmp___4); } } int batadv_recv_unicast_tvlv(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_unicast_tvlv_packet *unicast_tvlv_packet ; unsigned char *tvlv_buff ; uint16_t tvlv_buff_len ; int hdr_size ; int ret ; int tmp___0 ; int tmp___1 ; int tmp___2 ; __u16 tmp___3 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; hdr_size = 20; ret = 1; tmp___0 = batadv_check_unicast_packet(bat_priv, skb, hdr_size); if (tmp___0 < 0) { return (1); } else { } tmp___1 = skb_cow___0(skb, (unsigned int )hdr_size); if (tmp___1 < 0) { return (1); } else { } tmp___2 = skb_linearize(skb); if (tmp___2 < 0) { return (1); } else { } unicast_tvlv_packet = (struct batadv_unicast_tvlv_packet *)skb->data; tvlv_buff = skb->data + (unsigned long )hdr_size; tmp___3 = __fswab16((int )unicast_tvlv_packet->tvlv_len); tvlv_buff_len = tmp___3; if ((unsigned int )tvlv_buff_len > skb->len - (unsigned int )hdr_size) { return (1); } else { } ret = batadv_tvlv_containers_process(bat_priv, 0, (struct batadv_orig_node *)0, (uint8_t *)(& unicast_tvlv_packet->src), (uint8_t *)(& unicast_tvlv_packet->dst), (void *)tvlv_buff, (int )tvlv_buff_len); if (ret != 0) { ret = batadv_route_unicast_packet(skb, recv_if); } else { consume_skb(skb); } return (ret); } } int batadv_recv_frag_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_orig_node *orig_node_src ; struct batadv_frag_packet *frag_packet ; int ret ; int tmp___0 ; int tmp___1 ; bool tmp___2 ; bool tmp___3 ; int tmp___4 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; orig_node_src = (struct batadv_orig_node *)0; ret = 1; tmp___0 = batadv_check_unicast_packet(bat_priv, skb, 20); if (tmp___0 < 0) { goto out; } else { } frag_packet = (struct batadv_frag_packet *)skb->data; orig_node_src = batadv_orig_hash_find___5(bat_priv, (void const *)(& frag_packet->orig)); if ((unsigned long )orig_node_src == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tmp___1 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& frag_packet->dest)); if (tmp___1 == 0) { tmp___2 = batadv_frag_skb_fwd(skb, recv_if, orig_node_src); if ((int )tmp___2) { ret = 0; goto out; } else { } } else { } batadv_add_counter___0(bat_priv, 13UL, 1UL); batadv_add_counter___0(bat_priv, 14UL, (size_t )skb->len); tmp___3 = batadv_frag_skb_buffer(& skb, orig_node_src); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { goto out; } else { } if ((unsigned long )skb != (unsigned long )((struct sk_buff *)0)) { batadv_batman_skb_recv(skb, recv_if->net_dev, & recv_if->batman_adv_ptype, (struct net_device *)0); } else { } ret = 0; out: ; if ((unsigned long )orig_node_src != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node_src); } else { } return (ret); } } int batadv_recv_bcast_packet(struct sk_buff *skb , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_orig_node *orig_node ; struct batadv_bcast_packet *bcast_packet ; struct ethhdr *ethhdr ; int hdr_size ; int ret ; int32_t seq_diff ; uint32_t seqno ; int tmp___0 ; long tmp___1 ; bool tmp___2 ; int tmp___3 ; bool tmp___4 ; int tmp___5 ; int tmp___6 ; __u32 tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; int tmp___12 ; bool tmp___13 ; bool tmp___14 ; { tmp = netdev_priv((struct net_device const *)recv_if->soft_iface); bat_priv = (struct batadv_priv *)tmp; orig_node = (struct batadv_orig_node *)0; hdr_size = 14; ret = 1; tmp___0 = pskb_may_pull(skb, (unsigned int )hdr_size); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { goto out; } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___2 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_dest)); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { goto out; } else { } tmp___4 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_source)); if ((int )tmp___4) { goto out; } else { } tmp___5 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& ethhdr->h_source)); if (tmp___5 != 0) { goto out; } else { } bcast_packet = (struct batadv_bcast_packet *)skb->data; tmp___6 = batadv_is_my_mac(bat_priv, (uint8_t const *)(& bcast_packet->orig)); if (tmp___6 != 0) { goto out; } else { } if ((unsigned int )bcast_packet->ttl <= 1U) { goto out; } else { } orig_node = batadv_orig_hash_find___5(bat_priv, (void const *)(& bcast_packet->orig)); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } spin_lock_bh(& orig_node->bcast_seqno_lock); tmp___7 = __fswab32(bcast_packet->seqno); seqno = tmp___7; tmp___8 = batadv_test_bit((unsigned long const *)(& orig_node->bcast_bits), orig_node->last_bcast_seqno, seqno); if (tmp___8 != 0) { goto spin_unlock; } else { } seq_diff = (int32_t )(seqno - orig_node->last_bcast_seqno); tmp___9 = batadv_window_protected(bat_priv, seq_diff, & orig_node->bcast_seqno_reset); if (tmp___9 != 0) { goto spin_unlock; } else { } tmp___10 = batadv_bit_get_packet((void *)bat_priv, (unsigned long *)(& orig_node->bcast_bits), seq_diff, 1); if (tmp___10 != 0) { orig_node->last_bcast_seqno = seqno; } else { } spin_unlock_bh(& orig_node->bcast_seqno_lock); tmp___11 = batadv_bla_check_bcast_duplist(bat_priv, skb); if (tmp___11 != 0) { goto out; } else { } batadv_skb_set_priority(skb, 14); batadv_add_bcast_packet_to_list(bat_priv, (struct sk_buff const *)skb, 1UL); tmp___12 = batadv_bla_is_backbone_gw(skb, orig_node, hdr_size); if (tmp___12 != 0) { goto out; } else { } tmp___13 = batadv_dat_snoop_incoming_arp_request(bat_priv, skb, hdr_size); if ((int )tmp___13) { goto rx_success; } else { } tmp___14 = batadv_dat_snoop_incoming_arp_reply(bat_priv, skb, hdr_size); if ((int )tmp___14) { goto rx_success; } else { } batadv_interface_rx(recv_if->soft_iface, skb, recv_if, hdr_size, orig_node); rx_success: ret = 0; goto out; spin_unlock: spin_unlock_bh(& orig_node->bcast_seqno_lock); out: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (ret); } } void *ldv_kmem_cache_alloc_642(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_648(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_650(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_652(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_653(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_654(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_655(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_656(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_657(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_658(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_659(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_686(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_703(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_694(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_702(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_705(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_696(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_704(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_692(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_700(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_701(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; __inline static void skb_set_network_header(struct sk_buff *skb , int const offset ) { { skb_reset_network_header(skb); skb->network_header = (int )skb->network_header + (int )((__u16 )offset); return; } } struct sk_buff *ldv___netdev_alloc_skb_697(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_698(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_699(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; extern int dev_queue_xmit(struct sk_buff * ) ; int batadv_send_skb_unicast(struct batadv_priv *bat_priv , struct sk_buff *skb , int packet_type , int packet_subtype , struct batadv_orig_node *orig_node , unsigned short vid ) ; int batadv_send_skb_via_gw(struct batadv_priv *bat_priv , struct sk_buff *skb , unsigned short vid ) ; bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv , uint8_t *addr , unsigned short vid ) ; static void batadv_send_outstanding_bcast_packet(struct work_struct *work ) ; int batadv_send_skb_packet(struct sk_buff *skb , struct batadv_hard_iface *hard_iface , uint8_t const *dst_addr ) { struct batadv_priv *bat_priv ; void *tmp ; struct ethhdr *ethhdr ; long tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; if ((int )((signed char )hard_iface->if_status) != 3) { goto send_skb_err; } else { } tmp___0 = ldv__builtin_expect((unsigned long )hard_iface->net_dev == (unsigned long )((struct net_device *)0), 0L); if (tmp___0 != 0L) { goto send_skb_err; } else { } if (((hard_iface->net_dev)->flags & 1U) == 0U) { printk("\fbatman_adv: Interface %s is not up - can\'t send packet via that interface!\n", (char *)(& (hard_iface->net_dev)->name)); goto send_skb_err; } else { } tmp___1 = batadv_skb_head_push(skb, 14U); if (tmp___1 < 0) { goto send_skb_err; } else { } skb_reset_mac_header(skb); ethhdr = eth_hdr((struct sk_buff const *)skb); ether_addr_copy((u8 *)(& ethhdr->h_source), (u8 const *)(hard_iface->net_dev)->dev_addr); ether_addr_copy((u8 *)(& ethhdr->h_dest), dst_addr); ethhdr->h_proto = 1347U; skb_set_network_header(skb, 14); skb->protocol = 1347U; skb->dev = hard_iface->net_dev; batadv_nc_skb_store_for_decoding(bat_priv, skb); tmp___2 = dev_queue_xmit(skb); return (tmp___2); send_skb_err: kfree_skb(skb); return (1); } } int batadv_send_skb_to_orig(struct sk_buff *skb , struct batadv_orig_node *orig_node , struct batadv_hard_iface *recv_if ) { struct batadv_priv *bat_priv ; struct batadv_neigh_node *neigh_node ; int ret ; bool tmp ; int tmp___0 ; bool tmp___1 ; { bat_priv = orig_node->bat_priv; ret = 1; neigh_node = batadv_find_router(bat_priv, orig_node, recv_if); if ((unsigned long )neigh_node == (unsigned long )((struct batadv_neigh_node *)0)) { goto out; } else { } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->fragmentation)); if (tmp___0 != 0 && skb->len > ((neigh_node->if_incoming)->net_dev)->mtu) { tmp = batadv_frag_send_packet(skb, orig_node, neigh_node); if ((int )tmp) { ret = 0; } else { } goto out; } else { } if ((unsigned long )recv_if != (unsigned long )((struct batadv_hard_iface *)0)) { tmp___1 = batadv_nc_skb_forward(skb, neigh_node); if ((int )tmp___1) { ret = 3; } else { batadv_send_skb_packet(skb, neigh_node->if_incoming, (uint8_t const *)(& neigh_node->addr)); ret = 0; } } else { batadv_send_skb_packet(skb, neigh_node->if_incoming, (uint8_t const *)(& neigh_node->addr)); ret = 0; } out: ; if ((unsigned long )neigh_node != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(neigh_node); } else { } return (ret); } } static bool batadv_send_skb_push_fill_unicast(struct sk_buff *skb , int hdr_size , struct batadv_orig_node *orig_node ) { struct batadv_unicast_packet *unicast_packet ; uint8_t ttvn ; int tmp ; int tmp___0 ; { tmp = atomic_read((atomic_t const *)(& orig_node->last_ttvn)); ttvn = (unsigned char )tmp; tmp___0 = batadv_skb_head_push(skb, (unsigned int )hdr_size); if (tmp___0 < 0) { return (0); } else { } unicast_packet = (struct batadv_unicast_packet *)skb->data; unicast_packet->version = 15U; unicast_packet->packet_type = 64U; unicast_packet->ttl = 50U; ether_addr_copy((u8 *)(& unicast_packet->dest), (u8 const *)(& orig_node->orig)); unicast_packet->ttvn = ttvn; return (1); } } static bool batadv_send_skb_prepare_unicast(struct sk_buff *skb , struct batadv_orig_node *orig_node ) { size_t uni_size ; bool tmp ; { uni_size = 10UL; tmp = batadv_send_skb_push_fill_unicast(skb, (int )uni_size, orig_node); return (tmp); } } bool batadv_send_skb_prepare_unicast_4addr(struct batadv_priv *bat_priv , struct sk_buff *skb , struct batadv_orig_node *orig , int packet_subtype ) { struct batadv_hard_iface *primary_if ; struct batadv_unicast_4addr_packet *uc_4addr_packet ; bool ret ; bool tmp ; int tmp___0 ; { ret = 0; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } tmp = batadv_send_skb_push_fill_unicast(skb, 18, orig); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto out; } else { } uc_4addr_packet = (struct batadv_unicast_4addr_packet *)skb->data; uc_4addr_packet->u.packet_type = 66U; ether_addr_copy((u8 *)(& uc_4addr_packet->src), (u8 const *)(primary_if->net_dev)->dev_addr); uc_4addr_packet->subtype = (uint8_t )packet_subtype; uc_4addr_packet->reserved = 0U; ret = 1; out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (ret); } } int batadv_send_skb_unicast(struct batadv_priv *bat_priv , struct sk_buff *skb , int packet_type , int packet_subtype , struct batadv_orig_node *orig_node , unsigned short vid ) { struct ethhdr *ethhdr ; struct batadv_unicast_packet *unicast_packet ; int ret ; bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; { ret = 1; if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } switch (packet_type) { case 64: tmp = batadv_send_skb_prepare_unicast(skb, orig_node); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto out; } else { } goto ldv_50004; case 66: tmp___1 = batadv_send_skb_prepare_unicast_4addr(bat_priv, skb, orig_node, packet_subtype); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto out; } else { } goto ldv_50004; default: ; goto out; } ldv_50004: ethhdr = eth_hdr((struct sk_buff const *)skb); unicast_packet = (struct batadv_unicast_packet *)skb->data; tmp___3 = batadv_tt_global_client_is_roaming(bat_priv, (uint8_t *)(& ethhdr->h_dest), (int )vid); if ((int )tmp___3) { unicast_packet->ttvn = (unsigned int )unicast_packet->ttvn + 255U; } else { } tmp___4 = batadv_send_skb_to_orig(skb, orig_node, (struct batadv_hard_iface *)0); if (tmp___4 != 1) { ret = 0; } else { } out: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } if (ret == 1) { kfree_skb(skb); } else { } return (ret); } } int batadv_send_skb_via_tt_generic(struct batadv_priv *bat_priv , struct sk_buff *skb , int packet_type , int packet_subtype , uint8_t *dst_hint , unsigned short vid ) { struct ethhdr *ethhdr ; struct batadv_orig_node *orig_node ; uint8_t *src ; uint8_t *dst ; int tmp ; { ethhdr = (struct ethhdr *)skb->data; src = (uint8_t *)(& ethhdr->h_source); dst = (uint8_t *)(& ethhdr->h_dest); if ((unsigned long )dst_hint != (unsigned long )((uint8_t *)0U)) { src = (uint8_t *)0U; dst = dst_hint; } else { } orig_node = batadv_transtable_search(bat_priv, (uint8_t const *)src, (uint8_t const *)dst, (int )vid); tmp = batadv_send_skb_unicast(bat_priv, skb, packet_type, packet_subtype, orig_node, (int )vid); return (tmp); } } int batadv_send_skb_via_gw(struct batadv_priv *bat_priv , struct sk_buff *skb , unsigned short vid ) { struct batadv_orig_node *orig_node ; int tmp ; { orig_node = batadv_gw_get_selected_orig(bat_priv); tmp = batadv_send_skb_unicast(bat_priv, skb, 64, 0, orig_node, (int )vid); return (tmp); } } void batadv_schedule_bat_ogm(struct batadv_hard_iface *hard_iface ) { struct batadv_priv *bat_priv ; void *tmp ; { tmp = netdev_priv((struct net_device const *)hard_iface->soft_iface); bat_priv = (struct batadv_priv *)tmp; if ((int )((signed char )hard_iface->if_status) == 0 || (int )((signed char )hard_iface->if_status) == 1) { return; } else { } if ((int )((signed char )hard_iface->if_status) == 4) { hard_iface->if_status = 3; } else { } (*((bat_priv->bat_algo_ops)->bat_ogm_schedule))(hard_iface); return; } } static void batadv_forw_packet_free(struct batadv_forw_packet *forw_packet ) { { if ((unsigned long )forw_packet->skb != (unsigned long )((struct sk_buff *)0)) { kfree_skb(forw_packet->skb); } else { } if ((unsigned long )forw_packet->if_incoming != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(forw_packet->if_incoming); } else { } if ((unsigned long )forw_packet->if_outgoing != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(forw_packet->if_outgoing); } else { } kfree((void const *)forw_packet); return; } } static void _batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv , struct batadv_forw_packet *forw_packet , unsigned long send_time ) { { spin_lock_bh(& bat_priv->forw_bcast_list_lock); hlist_add_head(& forw_packet->list, & bat_priv->forw_bcast_list); spin_unlock_bh(& bat_priv->forw_bcast_list_lock); queue_delayed_work(batadv_event_workqueue, & forw_packet->delayed_work, send_time); return; } } int batadv_add_bcast_packet_to_list(struct batadv_priv *bat_priv , struct sk_buff const *skb , unsigned long delay ) { struct batadv_hard_iface *primary_if ; struct batadv_forw_packet *forw_packet ; struct batadv_bcast_packet *bcast_packet ; struct sk_buff *newskb ; int tmp ; int tmp___0 ; void *tmp___1 ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___0 ; { primary_if = (struct batadv_hard_iface *)0; tmp___0 = atomic_add_unless(& bat_priv->bcast_queue_left, -1, 0); if (tmp___0 == 0) { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp & 1) { batadv_debug_log(bat_priv, "bcast packet queue full\n"); } else { } goto out; } else { } primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out_and_inc; } else { } tmp___1 = kmalloc(296UL, 32U); forw_packet = (struct batadv_forw_packet *)tmp___1; if ((unsigned long )forw_packet == (unsigned long )((struct batadv_forw_packet *)0)) { goto out_and_inc; } else { } newskb = ldv_skb_copy_704(skb, 32U); if ((unsigned long )newskb == (unsigned long )((struct sk_buff *)0)) { goto packet_free; } else { } bcast_packet = (struct batadv_bcast_packet *)newskb->data; bcast_packet->ttl = (uint8_t )((int )bcast_packet->ttl - 1); skb_reset_mac_header(newskb); forw_packet->skb = newskb; forw_packet->if_incoming = primary_if; forw_packet->if_outgoing = (struct batadv_hard_iface *)0; forw_packet->num_packets = 0U; __init_work(& forw_packet->delayed_work.work, 0); __constr_expr_0.counter = 137438953408L; forw_packet->delayed_work.work.data = __constr_expr_0; lockdep_init_map(& forw_packet->delayed_work.work.lockdep_map, "(&(&forw_packet->delayed_work)->work)", & __key, 0); INIT_LIST_HEAD(& forw_packet->delayed_work.work.entry); forw_packet->delayed_work.work.func = & batadv_send_outstanding_bcast_packet; init_timer_key(& forw_packet->delayed_work.timer, 2U, "(&(&forw_packet->delayed_work)->timer)", & __key___0); forw_packet->delayed_work.timer.function = & delayed_work_timer_fn; forw_packet->delayed_work.timer.data = (unsigned long )(& forw_packet->delayed_work); _batadv_add_bcast_packet_to_list(bat_priv, forw_packet, delay); return (0); packet_free: kfree((void const *)forw_packet); out_and_inc: atomic_inc(& bat_priv->bcast_queue_left); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (16); } } static void batadv_send_outstanding_bcast_packet(struct work_struct *work ) { struct batadv_hard_iface *hard_iface ; struct delayed_work *delayed_work ; struct batadv_forw_packet *forw_packet ; struct sk_buff *skb1 ; struct net_device *soft_iface ; struct batadv_priv *bat_priv ; struct work_struct const *__mptr ; struct delayed_work const *__mptr___0 ; void *tmp ; int tmp___0 ; bool tmp___1 ; struct list_head *__ptr ; struct list_head const *__mptr___1 ; struct list_head *_________p1 ; bool __warned ; int tmp___2 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___2 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___3 ; unsigned long tmp___4 ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; forw_packet = (struct batadv_forw_packet *)__mptr___0 + 0xffffffffffffffc8UL; soft_iface = (forw_packet->if_incoming)->soft_iface; tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; spin_lock_bh(& bat_priv->forw_bcast_list_lock); hlist_del(& forw_packet->list); spin_unlock_bh(& bat_priv->forw_bcast_list_lock); tmp___0 = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp___0 == 2) { goto out; } else { } tmp___1 = batadv_dat_drop_broadcast_packet(bat_priv, forw_packet); if ((int )tmp___1) { goto out; } else { } rcu_read_lock(); __ptr = batadv_hardif_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr___1 = (struct list_head const *)_________p1; hard_iface = (struct batadv_hard_iface *)__mptr___1; goto ldv_50082; ldv_50081: ; if ((unsigned long )hard_iface->soft_iface != (unsigned long )soft_iface) { goto ldv_50080; } else { } if ((int )forw_packet->num_packets >= (int )hard_iface->num_bcasts) { goto ldv_50080; } else { } skb1 = ldv_skb_clone_705(forw_packet->skb, 32U); if ((unsigned long )skb1 != (unsigned long )((struct sk_buff *)0)) { batadv_send_skb_packet(skb1, hard_iface, (uint8_t const *)(& batadv_broadcast_addr)); } else { } ldv_50080: __ptr___0 = hard_iface->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___2 = (struct list_head const *)_________p1___0; hard_iface = (struct batadv_hard_iface *)__mptr___2; ldv_50082: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50081; } else { } rcu_read_unlock(); forw_packet->num_packets = (uint8_t )((int )forw_packet->num_packets + 1); if ((unsigned int )forw_packet->num_packets <= 2U) { tmp___4 = msecs_to_jiffies(5U); _batadv_add_bcast_packet_to_list(bat_priv, forw_packet, tmp___4); return; } else { } out: batadv_forw_packet_free(forw_packet); atomic_inc(& bat_priv->bcast_queue_left); return; } } void batadv_send_outstanding_bat_ogm_packet(struct work_struct *work ) { struct delayed_work *delayed_work ; struct batadv_forw_packet *forw_packet ; struct batadv_priv *bat_priv ; struct work_struct const *__mptr ; struct delayed_work const *__mptr___0 ; void *tmp ; int tmp___0 ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; forw_packet = (struct batadv_forw_packet *)__mptr___0 + 0xffffffffffffffc8UL; tmp = netdev_priv((struct net_device const *)(forw_packet->if_incoming)->soft_iface); bat_priv = (struct batadv_priv *)tmp; spin_lock_bh(& bat_priv->forw_bat_list_lock); hlist_del(& forw_packet->list); spin_unlock_bh(& bat_priv->forw_bat_list_lock); tmp___0 = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp___0 == 2) { goto out; } else { } (*((bat_priv->bat_algo_ops)->bat_ogm_emit))(forw_packet); if ((unsigned int )forw_packet->own != 0U && (unsigned long )forw_packet->if_incoming == (unsigned long )forw_packet->if_outgoing) { batadv_schedule_bat_ogm(forw_packet->if_incoming); } else { } out: ; if ((unsigned int )forw_packet->own == 0U) { atomic_inc(& bat_priv->batman_queue_left); } else { } batadv_forw_packet_free(forw_packet); return; } } void batadv_purge_outstanding_packets(struct batadv_priv *bat_priv , struct batadv_hard_iface const *hard_iface ) { struct batadv_forw_packet *forw_packet ; struct hlist_node *safe_tmp_node ; bool pending ; int tmp ; int tmp___0 ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_forw_packet *tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_forw_packet *tmp___2 ; struct hlist_node *____ptr___1 ; struct hlist_node const *__mptr___1 ; struct batadv_forw_packet *tmp___3 ; struct hlist_node *____ptr___2 ; struct hlist_node const *__mptr___2 ; struct batadv_forw_packet *tmp___4 ; { if ((unsigned long )hard_iface != (unsigned long )((struct batadv_hard_iface const *)0)) { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp & 1) { batadv_debug_log(bat_priv, "purge_outstanding_packets(): %s\n", (char *)(& (hard_iface->net_dev)->name)); } else { } } else { tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___0 & 1) { batadv_debug_log(bat_priv, "purge_outstanding_packets()\n"); } else { } } spin_lock_bh(& bat_priv->forw_bcast_list_lock); ____ptr = bat_priv->forw_bcast_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_forw_packet *)__mptr; } else { tmp___1 = (struct batadv_forw_packet *)0; } forw_packet = tmp___1; goto ldv_50113; ldv_50112: ; if ((unsigned long )hard_iface != (unsigned long )((struct batadv_hard_iface const *)0) && (unsigned long )((struct batadv_hard_iface const *)forw_packet->if_incoming) != (unsigned long )hard_iface) { goto ldv_50111; } else { } spin_unlock_bh(& bat_priv->forw_bcast_list_lock); pending = cancel_delayed_work_sync(& forw_packet->delayed_work); spin_lock_bh(& bat_priv->forw_bcast_list_lock); if ((int )pending) { hlist_del(& forw_packet->list); batadv_forw_packet_free(forw_packet); } else { } ldv_50111: ____ptr___0 = safe_tmp_node; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_forw_packet *)__mptr___0; } else { tmp___2 = (struct batadv_forw_packet *)0; } forw_packet = tmp___2; ldv_50113: ; if ((unsigned long )forw_packet != (unsigned long )((struct batadv_forw_packet *)0)) { safe_tmp_node = forw_packet->list.next; goto ldv_50112; } else { } spin_unlock_bh(& bat_priv->forw_bcast_list_lock); spin_lock_bh(& bat_priv->forw_bat_list_lock); ____ptr___1 = bat_priv->forw_bat_list.first; if ((unsigned long )____ptr___1 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___1; tmp___3 = (struct batadv_forw_packet *)__mptr___1; } else { tmp___3 = (struct batadv_forw_packet *)0; } forw_packet = tmp___3; goto ldv_50126; ldv_50125: ; if (((unsigned long )hard_iface != (unsigned long )((struct batadv_hard_iface const *)0) && (unsigned long )((struct batadv_hard_iface const *)forw_packet->if_incoming) != (unsigned long )hard_iface) && (unsigned long )((struct batadv_hard_iface const *)forw_packet->if_outgoing) != (unsigned long )hard_iface) { goto ldv_50124; } else { } spin_unlock_bh(& bat_priv->forw_bat_list_lock); pending = cancel_delayed_work_sync(& forw_packet->delayed_work); spin_lock_bh(& bat_priv->forw_bat_list_lock); if ((int )pending) { hlist_del(& forw_packet->list); batadv_forw_packet_free(forw_packet); } else { } ldv_50124: ____ptr___2 = safe_tmp_node; if ((unsigned long )____ptr___2 != (unsigned long )((struct hlist_node *)0)) { __mptr___2 = (struct hlist_node const *)____ptr___2; tmp___4 = (struct batadv_forw_packet *)__mptr___2; } else { tmp___4 = (struct batadv_forw_packet *)0; } forw_packet = tmp___4; ldv_50126: ; if ((unsigned long )forw_packet != (unsigned long )((struct batadv_forw_packet *)0)) { safe_tmp_node = forw_packet->list.next; goto ldv_50125; } else { } spin_unlock_bh(& bat_priv->forw_bat_list_lock); return; } } void *ldv_kmem_cache_alloc_686(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_692(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_694(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_696(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_697(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_698(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_699(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_700(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_701(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_702(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_703(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } struct sk_buff *ldv_skb_copy_704(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_705(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } __inline static void clear_bit(long nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } extern unsigned long find_next_bit(unsigned long const * , unsigned long , unsigned long ) ; extern unsigned long __per_cpu_offset[8192U] ; extern size_t strlcpy(char * , char const * , size_t ) ; extern int nr_cpu_ids ; extern struct cpumask const * const cpu_possible_mask ; __inline static unsigned int cpumask_check(unsigned int cpu ) { bool __warned ; int __ret_warn_once ; int __ret_warn_on ; long tmp ; long tmp___0 ; long tmp___1 ; { __ret_warn_once = (unsigned int )nr_cpu_ids <= cpu; tmp___1 = ldv__builtin_expect(__ret_warn_once != 0, 0L); if (tmp___1 != 0L) { __ret_warn_on = ! __warned; tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/cpumask.h", 108); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { __warned = 1; } else { } } else { } ldv__builtin_expect(__ret_warn_once != 0, 0L); return (cpu); } } __inline static unsigned int cpumask_next(int n , struct cpumask const *srcp ) { unsigned long tmp ; { if (n != -1) { cpumask_check((unsigned int )n); } else { } tmp = find_next_bit((unsigned long const *)(& srcp->bits), (unsigned long )nr_cpu_ids, (unsigned long )(n + 1)); return ((unsigned int )tmp); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; extern void *__alloc_percpu(size_t , size_t ) ; void *ldv_kmem_cache_alloc_734(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_751(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; extern u32 __VERIFIER_nondet_u32(void) ; extern u16 __VERIFIER_nondet_u16(void) ; struct sk_buff *ldv_skb_clone_742(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_750(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_744(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_740(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_748(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_749(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_745(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_746(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_747(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static int __skb_cow___3(struct sk_buff *skb , unsigned int headroom , int cloned ) { int delta ; unsigned int tmp ; unsigned int tmp___0 ; int _max1 ; int _max2 ; int _max1___0 ; int _max2___0 ; int tmp___1 ; { delta = 0; tmp___0 = skb_headroom((struct sk_buff const *)skb); if (tmp___0 < headroom) { tmp = skb_headroom((struct sk_buff const *)skb); delta = (int )(headroom - tmp); } else { } if (delta != 0 || cloned != 0) { _max1 = 32; _max2 = 64; _max1___0 = 32; _max2___0 = 64; tmp___1 = ldv_pskb_expand_head_748(skb, (((_max1 > _max2 ? _max1 : _max2) + -1) + delta) & - (_max1___0 > _max2___0 ? _max1___0 : _max2___0), 0, 32U); return (tmp___1); } else { } return (0); } } __inline static int skb_cow_head___1(struct sk_buff *skb , unsigned int headroom ) { int tmp ; int tmp___0 ; { tmp = skb_header_cloned((struct sk_buff const *)skb); tmp___0 = __skb_cow___3(skb, headroom, tmp); return (tmp___0); } } extern void nf_conntrack_destroy(struct nf_conntrack * ) ; __inline static void nf_conntrack_put(struct nf_conntrack *nfct ) { int tmp ; { if ((unsigned long )nfct != (unsigned long )((struct nf_conntrack *)0)) { tmp = atomic_dec_and_test(& nfct->use); if (tmp != 0) { nf_conntrack_destroy(nfct); } else { } } else { } return; } } __inline static void nf_bridge_put(struct nf_bridge_info *nf_bridge ) { int tmp ; { if ((unsigned long )nf_bridge != (unsigned long )((struct nf_bridge_info *)0)) { tmp = atomic_dec_and_test(& nf_bridge->use); if (tmp != 0) { kfree((void const *)nf_bridge); } else { } } else { } return; } } __inline static void nf_reset(struct sk_buff *skb ) { { nf_conntrack_put(skb->nfct); skb->nfct = (struct nf_conntrack *)0; nf_bridge_put(skb->nf_bridge); skb->nf_bridge = (struct nf_bridge_info *)0; return; } } __inline static void ethtool_cmd_speed_set(struct ethtool_cmd *ep , __u32 speed ) { { ep->speed = (unsigned short )speed; ep->speed_hi = (unsigned short )(speed >> 16); return; } } __inline static struct netdev_queue *netdev_get_tx_queue(struct net_device const *dev , unsigned int index ) { { return ((struct netdev_queue *)dev->_tx + (unsigned long )index); } } __inline static void netdev_for_each_tx_queue(struct net_device *dev , void (*f)(struct net_device * , struct netdev_queue * , void * ) , void *arg ) { unsigned int i ; { i = 0U; goto ldv_40358; ldv_40357: (*f)(dev, dev->_tx + (unsigned long )i, arg); i = i + 1U; ldv_40358: ; if (dev->num_tx_queues > i) { goto ldv_40357; } else { } return; } } extern int register_netdevice(struct net_device * ) ; extern void unregister_netdevice_queue(struct net_device * , struct list_head * ) ; extern void free_netdev(struct net_device * ) ; __inline static void netif_tx_start_queue(struct netdev_queue *dev_queue ) { { clear_bit(0L, (unsigned long volatile *)(& dev_queue->state)); return; } } __inline static void netif_start_queue(struct net_device *dev ) { struct netdev_queue *tmp ; { tmp = netdev_get_tx_queue((struct net_device const *)dev, 0U); netif_tx_start_queue(tmp); return; } } __inline static void netif_tx_stop_queue(struct netdev_queue *dev_queue ) { int __ret_warn_on ; long tmp ; long tmp___0 ; { __ret_warn_on = (unsigned long )dev_queue == (unsigned long )((struct netdev_queue *)0); tmp = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp != 0L) { warn_slowpath_null("include/linux/netdevice.h", 2212); } else { } tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { printk("\016batman_adv: netif_stop_queue() cannot be called before register_netdev()\n"); return; } else { } set_bit(0L, (unsigned long volatile *)(& dev_queue->state)); return; } } __inline static void netif_stop_queue(struct net_device *dev ) { struct netdev_queue *tmp ; { tmp = netdev_get_tx_queue((struct net_device const *)dev, 0U); netif_tx_stop_queue(tmp); return; } } extern void ether_setup(struct net_device * ) ; extern struct net_device *alloc_netdev_mqs(int , char const * , void (*)(struct net_device * ) , unsigned int , unsigned int ) ; extern void unregister_netdev(struct net_device * ) ; extern int eth_validate_addr(struct net_device * ) ; __inline static bool is_valid_ether_addr(u8 const *addr ) { bool tmp ; int tmp___0 ; bool tmp___1 ; int tmp___2 ; int tmp___3 ; { tmp = is_multicast_ether_addr(addr); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { tmp___1 = is_zero_ether_addr(addr); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { tmp___3 = 1; } else { tmp___3 = 0; } } else { tmp___3 = 0; } return ((bool )tmp___3); } } __inline static void eth_random_addr(u8 *addr ) { { get_random_bytes((void *)addr, 6); *addr = (unsigned int )*addr & 254U; *addr = (u8 )((unsigned int )*addr | 2U); return; } } __inline static void eth_hw_addr_random(struct net_device *dev ) { { dev->addr_assign_type = 1U; eth_random_addr(dev->dev_addr); return; } } __inline static uint64_t batadv_sum_counter(struct batadv_priv *bat_priv , size_t idx ) { uint64_t *counters ; uint64_t sum ; int cpu ; void const *__vpp_verify ; unsigned long __ptr ; unsigned int tmp ; { sum = 0ULL; cpu = -1; goto ldv_49296; ldv_49295: __vpp_verify = (void const *)0; __asm__ ("": "=r" (__ptr): "0" (bat_priv->bat_counters)); counters = (uint64_t *)(__per_cpu_offset[cpu] + __ptr); sum = *(counters + idx) + sum; ldv_49296: tmp = cpumask_next(cpu, cpu_possible_mask); cpu = (int )tmp; if (cpu < nr_cpu_ids) { goto ldv_49295; } else { } return (sum); } } bool batadv_tt_local_add(struct net_device *soft_iface , uint8_t const *addr , unsigned short vid , int ifindex , uint32_t mark ) ; uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid , char const *message , bool roaming ) ; bool batadv_is_ap_isolated(struct batadv_priv *bat_priv , uint8_t *src , uint8_t *dst , unsigned short vid ) ; bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , unsigned char const *addr , unsigned short vid ) ; bool batadv_tt_global_is_isolated(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) ; void batadv_sysfs_del_meshif(struct net_device *dev ) ; int batadv_sysfs_add_vlan(struct net_device *dev , struct batadv_softif_vlan *vlan ) ; void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv , struct batadv_softif_vlan *vlan ) ; enum batadv_forw_mode batadv_mcast_forw_mode(struct batadv_priv *bat_priv , struct sk_buff *skb , struct batadv_orig_node **orig ) ; static int batadv_get_settings(struct net_device *dev , struct ethtool_cmd *cmd ) ; static void batadv_get_drvinfo(struct net_device *dev , struct ethtool_drvinfo *info ) ; static u32 batadv_get_msglevel(struct net_device *dev ) ; static void batadv_set_msglevel(struct net_device *dev , u32 value ) ; static u32 batadv_get_link(struct net_device *dev ) ; static void batadv_get_strings(struct net_device *dev , unsigned int stringset , unsigned char *data ) ; static void batadv_get_ethtool_stats(struct net_device *dev , struct ethtool_stats *stats , unsigned long long *data ) ; static int batadv_get_sset_count(struct net_device *dev , int stringset ) ; static struct ethtool_ops const batadv_ethtool_ops = {& batadv_get_settings, 0, & batadv_get_drvinfo, 0, 0, 0, 0, & batadv_get_msglevel, & batadv_set_msglevel, 0, & batadv_get_link, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_get_strings, 0, & batadv_get_ethtool_stats, 0, 0, 0, 0, & batadv_get_sset_count, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int batadv_skb_head_push(struct sk_buff *skb , unsigned int len ) { int result ; { result = skb_cow_head___1(skb, len); if (result < 0) { return (result); } else { } skb_push(skb, len); return (0); } } static int batadv_interface_open(struct net_device *dev ) { { netif_start_queue(dev); return (0); } } static int batadv_interface_release(struct net_device *dev ) { { netif_stop_queue(dev); return (0); } } static struct net_device_stats *batadv_interface_stats(struct net_device *dev ) { struct batadv_priv *bat_priv ; void *tmp ; struct net_device_stats *stats ; uint64_t tmp___0 ; uint64_t tmp___1 ; uint64_t tmp___2 ; uint64_t tmp___3 ; uint64_t tmp___4 ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; stats = & bat_priv->stats; tmp___0 = batadv_sum_counter(bat_priv, 0UL); stats->tx_packets = (unsigned long )tmp___0; tmp___1 = batadv_sum_counter(bat_priv, 1UL); stats->tx_bytes = (unsigned long )tmp___1; tmp___2 = batadv_sum_counter(bat_priv, 2UL); stats->tx_dropped = (unsigned long )tmp___2; tmp___3 = batadv_sum_counter(bat_priv, 3UL); stats->rx_packets = (unsigned long )tmp___3; tmp___4 = batadv_sum_counter(bat_priv, 4UL); stats->rx_bytes = (unsigned long )tmp___4; return (stats); } } static int batadv_interface_set_mac_addr(struct net_device *dev , void *p ) { struct batadv_priv *bat_priv ; void *tmp ; struct sockaddr *addr ; uint8_t old_addr[6U] ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; addr = (struct sockaddr *)p; tmp___0 = is_valid_ether_addr((u8 const *)(& addr->sa_data)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (-99); } else { } ether_addr_copy((u8 *)(& old_addr), (u8 const *)dev->dev_addr); ether_addr_copy(dev->dev_addr, (u8 const *)(& addr->sa_data)); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp___2 == 1) { batadv_tt_local_remove(bat_priv, (uint8_t const *)(& old_addr), 0, "mac address changed", 0); batadv_tt_local_add(dev, (uint8_t const *)(& addr->sa_data), 0, 0, 0U); } else { } return (0); } } static int batadv_interface_change_mtu(struct net_device *dev , int new_mtu ) { int tmp ; { if (new_mtu <= 67) { return (-22); } else { tmp = batadv_hardif_min_mtu(dev); if (tmp < new_mtu) { return (-22); } else { } } dev->mtu = (unsigned int )new_mtu; return (0); } } static void batadv_interface_set_rx_mode(struct net_device *dev ) { { return; } } static int batadv_interface_tx(struct sk_buff *skb , struct net_device *soft_iface ) { struct ethhdr *ethhdr ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hard_iface *primary_if ; struct batadv_bcast_packet *bcast_packet ; __be16 ethertype ; uint8_t stp_addr[6U] ; uint8_t ectp_addr[6U] ; enum batadv_dhcp_recipient dhcp_rcp ; uint8_t *dst_hint ; uint8_t chaddr[6U] ; struct vlan_ethhdr *vhdr ; unsigned int header_len ; int data_len ; int ret ; unsigned long brd_delay ; bool do_bcast ; bool client_added ; unsigned short vid ; uint32_t seqno ; int gw_mode ; enum batadv_forw_mode forw_mode ; struct batadv_orig_node *mcast_single_orig ; int tmp___0 ; __u16 tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; bool tmp___7 ; int tmp___8 ; bool tmp___9 ; bool tmp___10 ; int tmp___11 ; int tmp___12 ; __u32 tmp___13 ; bool tmp___14 ; bool tmp___15 ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; primary_if = (struct batadv_hard_iface *)0; ethertype = 1347U; stp_addr[0] = 1U; stp_addr[1] = 128U; stp_addr[2] = 194U; stp_addr[3] = 0U; stp_addr[4] = 0U; stp_addr[5] = 0U; ectp_addr[0] = 207U; ectp_addr[1] = 0U; ectp_addr[2] = 0U; ectp_addr[3] = 0U; ectp_addr[4] = 0U; ectp_addr[5] = 0U; dhcp_rcp = 0; dst_hint = (uint8_t *)0U; header_len = 0U; data_len = (int )skb->len; brd_delay = 1UL; do_bcast = 0; mcast_single_orig = (struct batadv_orig_node *)0; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->mesh_state)); if (tmp___0 != 1) { goto dropped; } else { } soft_iface->trans_start = jiffies; vid = batadv_get_vid(skb, 0UL); ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___1 = __fswab16((int )ethhdr->h_proto); switch ((int )tmp___1) { case 33024: vhdr = vlan_eth_hdr((struct sk_buff const *)skb); if ((int )vhdr->h_vlan_encapsulated_proto != (int )ethertype) { goto ldv_50080; } else { } case 17157: ; goto dropped; } ldv_50080: tmp___2 = batadv_bla_tx(bat_priv, skb, (int )vid); if (tmp___2 != 0) { goto dropped; } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___3 = is_multicast_ether_addr((u8 const *)(& ethhdr->h_source)); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { client_added = batadv_tt_local_add(soft_iface, (uint8_t const *)(& ethhdr->h_source), (int )vid, skb->skb_iif, skb->ldv_31038.mark); if (! client_added) { goto dropped; } else { } } else { } tmp___5 = batadv_compare_eth((void const *)(& ethhdr->h_dest), (void const *)(& stp_addr)); if (tmp___5 != 0) { goto dropped; } else { } tmp___6 = batadv_compare_eth((void const *)(& ethhdr->h_dest), (void const *)(& ectp_addr)); if (tmp___6 != 0) { goto dropped; } else { } gw_mode = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); tmp___9 = is_multicast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___9) { if (gw_mode == 0) { do_bcast = 1; goto send; } else { } dhcp_rcp = batadv_gw_dhcp_recipient_get(skb, & header_len, (uint8_t *)(& chaddr)); ethhdr = eth_hdr((struct sk_buff const *)skb); if ((unsigned int )dhcp_rcp == 0U) { do_bcast = 1; goto send; } else { } if ((unsigned int )dhcp_rcp == 2U) { dst_hint = (uint8_t *)(& chaddr); } else if (gw_mode == 2 && (unsigned int )dhcp_rcp == 1U) { goto dropped; } else { } send: ; if ((int )do_bcast) { tmp___7 = is_broadcast_ether_addr((u8 const *)(& ethhdr->h_dest)); if (tmp___7) { tmp___8 = 0; } else { tmp___8 = 1; } if (tmp___8) { forw_mode = batadv_mcast_forw_mode(bat_priv, skb, & mcast_single_orig); if ((unsigned int )forw_mode == 2U) { goto dropped; } else { } if ((unsigned int )forw_mode == 1U) { do_bcast = 0; } else { } } else { } } else { } } else { } batadv_skb_set_priority(skb, 0); if ((int )do_bcast) { primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto dropped; } else { } tmp___10 = batadv_dat_snoop_outgoing_arp_request(bat_priv, skb); if ((int )tmp___10) { brd_delay = msecs_to_jiffies(250U); } else { } tmp___11 = batadv_skb_head_push(skb, 14U); if (tmp___11 < 0) { goto dropped; } else { } bcast_packet = (struct batadv_bcast_packet *)skb->data; bcast_packet->version = 15U; bcast_packet->ttl = 50U; bcast_packet->packet_type = 1U; bcast_packet->reserved = 0U; ether_addr_copy((u8 *)(& bcast_packet->orig), (u8 const *)(primary_if->net_dev)->dev_addr); tmp___12 = atomic_add_return(1, & bat_priv->bcast_seqno); seqno = (uint32_t )tmp___12; tmp___13 = __fswab32(seqno); bcast_packet->seqno = tmp___13; batadv_add_bcast_packet_to_list(bat_priv, (struct sk_buff const *)skb, brd_delay); kfree_skb(skb); } else { if ((unsigned int )dhcp_rcp == 1U) { tmp___14 = batadv_gw_out_of_range(bat_priv, skb); ret = (int )tmp___14; if (ret != 0) { goto dropped; } else { } ret = batadv_send_skb_via_gw(bat_priv, skb, (int )vid); } else if ((unsigned long )mcast_single_orig != (unsigned long )((struct batadv_orig_node *)0)) { ret = batadv_send_skb_unicast(bat_priv, skb, 64, 0, mcast_single_orig, (int )vid); } else { tmp___15 = batadv_dat_snoop_outgoing_arp_request(bat_priv, skb); if ((int )tmp___15) { goto dropped; } else { } batadv_dat_snoop_outgoing_arp_reply(bat_priv, skb); ret = batadv_send_skb_via_tt(bat_priv, skb, dst_hint, (int )vid); } if (ret == 1) { goto dropped_freed; } else { } } batadv_add_counter___0(bat_priv, 0UL, 1UL); batadv_add_counter___0(bat_priv, 1UL, (size_t )data_len); goto end; dropped: kfree_skb(skb); dropped_freed: batadv_add_counter___0(bat_priv, 2UL, 1UL); end: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } void batadv_interface_rx(struct net_device *soft_iface , struct sk_buff *skb , struct batadv_hard_iface *recv_if , int hdr_size , struct batadv_orig_node *orig_node ) { struct batadv_bcast_packet *batadv_bcast_packet ; struct batadv_priv *bat_priv ; void *tmp ; __be16 ethertype ; struct vlan_ethhdr *vhdr ; struct ethhdr *ethhdr ; unsigned short vid ; bool is_bcast ; int tmp___0 ; __u16 tmp___1 ; int tmp___2 ; long tmp___3 ; int tmp___4 ; bool tmp___5 ; bool tmp___6 ; bool tmp___7 ; bool tmp___8 ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; ethertype = 1347U; batadv_bcast_packet = (struct batadv_bcast_packet *)skb->data; is_bcast = (unsigned int )batadv_bcast_packet->packet_type == 1U; tmp___0 = pskb_may_pull(skb, (unsigned int )hdr_size); if (tmp___0 == 0) { goto dropped; } else { } skb_pull_rcsum(skb, (unsigned int )hdr_size); skb_reset_mac_header(skb); nf_reset(skb); vid = batadv_get_vid(skb, 0UL); ethhdr = eth_hdr((struct sk_buff const *)skb); tmp___1 = __fswab16((int )ethhdr->h_proto); switch ((int )tmp___1) { case 33024: vhdr = (struct vlan_ethhdr *)skb->data; if ((int )vhdr->h_vlan_encapsulated_proto != (int )ethertype) { goto ldv_50101; } else { } case 17157: ; goto dropped; } ldv_50101: tmp___2 = pskb_may_pull(skb, 14U); tmp___3 = ldv__builtin_expect(tmp___2 == 0, 0L); if (tmp___3 != 0L) { goto dropped; } else { } skb->protocol = eth_type_trans(skb, soft_iface); batadv_add_counter___0(bat_priv, 3UL, 1UL); batadv_add_counter___0(bat_priv, 4UL, (size_t )(skb->len + 14U)); soft_iface->last_rx = jiffies; tmp___4 = batadv_bla_rx(bat_priv, skb, (int )vid, (int )is_bcast); if (tmp___4 != 0) { goto out; } else { } if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_tt_add_temporary_global_entry(bat_priv, orig_node, (unsigned char const *)(& ethhdr->h_source), (int )vid); } else { } tmp___8 = is_multicast_ether_addr((u8 const *)(& ethhdr->h_dest)); if ((int )tmp___8) { tmp___5 = batadv_vlan_ap_isola_get(bat_priv, (int )vid); if ((int )tmp___5) { tmp___6 = batadv_tt_global_is_isolated(bat_priv, (uint8_t const *)(& ethhdr->h_source), (int )vid); if ((int )tmp___6) { skb->ldv_31038.mark = skb->ldv_31038.mark & ~ bat_priv->isolation_mark_mask; skb->ldv_31038.mark = skb->ldv_31038.mark | bat_priv->isolation_mark; } else { } } else { } } else { tmp___7 = batadv_is_ap_isolated(bat_priv, (uint8_t *)(& ethhdr->h_source), (uint8_t *)(& ethhdr->h_dest), (int )vid); if ((int )tmp___7) { goto dropped; } else { } } netif_rx(skb); goto out; dropped: kfree_skb(skb); out: ; return; } } void batadv_softif_vlan_free_ref(struct batadv_softif_vlan *softif_vlan ) { int tmp ; { tmp = atomic_dec_and_test(& softif_vlan->refcount); if (tmp != 0) { kfree_call_rcu(& softif_vlan->rcu, (void (*)(struct callback_head * ))56); } else { } return; } } struct batadv_softif_vlan *batadv_softif_vlan_get(struct batadv_priv *bat_priv , unsigned short vid ) { struct batadv_softif_vlan *vlan_tmp ; struct batadv_softif_vlan *vlan ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_softif_vlan *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_softif_vlan *tmp___3 ; { vlan = (struct batadv_softif_vlan *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->softif_vlan_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_softif_vlan *)__mptr + 0xffffffffffffffe0UL; } else { tmp___0 = (struct batadv_softif_vlan *)0; } vlan_tmp = tmp___0; goto ldv_50137; ldv_50136: ; if ((int )vlan_tmp->vid != (int )vid) { goto ldv_50134; } else { } tmp___1 = atomic_add_unless(& vlan_tmp->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_50134; } else { } vlan = vlan_tmp; goto ldv_50135; ldv_50134: _________p1___0 = *((struct hlist_node * volatile *)(& vlan_tmp->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_softif_vlan *)__mptr___0 + 0xffffffffffffffe0UL; } else { tmp___3 = (struct batadv_softif_vlan *)0; } vlan_tmp = tmp___3; ldv_50137: ; if ((unsigned long )vlan_tmp != (unsigned long )((struct batadv_softif_vlan *)0)) { goto ldv_50136; } else { } ldv_50135: rcu_read_unlock(); return (vlan); } } int batadv_softif_create_vlan(struct batadv_priv *bat_priv , unsigned short vid ) { struct batadv_softif_vlan *vlan ; int err ; void *tmp ; { vlan = batadv_softif_vlan_get(bat_priv, (int )vid); if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { batadv_softif_vlan_free_ref(vlan); return (-17); } else { } tmp = kzalloc(72UL, 32U); vlan = (struct batadv_softif_vlan *)tmp; if ((unsigned long )vlan == (unsigned long )((struct batadv_softif_vlan *)0)) { return (-12); } else { } vlan->vid = vid; atomic_set(& vlan->refcount, 1); atomic_set(& vlan->ap_isolation, 0); err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); if (err != 0) { kfree((void const *)vlan); return (err); } else { } batadv_tt_local_add(bat_priv->soft_iface, (uint8_t const *)(bat_priv->soft_iface)->dev_addr, (int )vid, 0, 0U); spin_lock_bh(& bat_priv->softif_vlan_list_lock); hlist_add_head_rcu(& vlan->list, & bat_priv->softif_vlan_list); spin_unlock_bh(& bat_priv->softif_vlan_list_lock); return (0); } } static void batadv_softif_destroy_vlan(struct batadv_priv *bat_priv , struct batadv_softif_vlan *vlan ) { { spin_lock_bh(& bat_priv->softif_vlan_list_lock); hlist_del_rcu(& vlan->list); spin_unlock_bh(& bat_priv->softif_vlan_list_lock); batadv_sysfs_del_vlan(bat_priv, vlan); batadv_tt_local_remove(bat_priv, (uint8_t const *)(bat_priv->soft_iface)->dev_addr, (int )vlan->vid, "vlan interface destroyed", 0); batadv_softif_vlan_free_ref(vlan); return; } } static int batadv_interface_add_vid(struct net_device *dev , __be16 proto , unsigned short vid ) { struct batadv_priv *bat_priv ; void *tmp ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; if ((unsigned int )proto != 129U) { return (-22); } else { } vid = (unsigned int )vid | 32768U; tmp___0 = batadv_softif_create_vlan(bat_priv, (int )vid); return (tmp___0); } } static int batadv_interface_kill_vid(struct net_device *dev , __be16 proto , unsigned short vid ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_softif_vlan *vlan ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; if ((unsigned int )proto != 129U) { return (-22); } else { } vlan = batadv_softif_vlan_get(bat_priv, (int )((unsigned int )vid | 32768U)); if ((unsigned long )vlan == (unsigned long )((struct batadv_softif_vlan *)0)) { return (-2); } else { } batadv_softif_destroy_vlan(bat_priv, vlan); batadv_softif_vlan_free_ref(vlan); return (0); } } static struct lock_class_key batadv_netdev_xmit_lock_key ; static struct lock_class_key batadv_netdev_addr_lock_key ; static void batadv_set_lockdep_class_one(struct net_device *dev , struct netdev_queue *txq , void *_unused ) { { lockdep_init_map(& txq->_xmit_lock.ldv_6347.ldv_6346.dep_map, "&batadv_netdev_xmit_lock_key", & batadv_netdev_xmit_lock_key, 0); return; } } static void batadv_set_lockdep_class(struct net_device *dev ) { { lockdep_init_map(& dev->addr_list_lock.ldv_6347.ldv_6346.dep_map, "&batadv_netdev_addr_lock_key", & batadv_netdev_addr_lock_key, 0); netdev_for_each_tx_queue(dev, & batadv_set_lockdep_class_one, (void *)0); return; } } static void batadv_softif_destroy_finish(struct work_struct *work ) { struct batadv_softif_vlan *vlan ; struct batadv_priv *bat_priv ; struct net_device *soft_iface ; struct work_struct const *__mptr ; { __mptr = (struct work_struct const *)work; bat_priv = (struct batadv_priv *)__mptr + 0xfffffffffffffd48UL; soft_iface = bat_priv->soft_iface; vlan = batadv_softif_vlan_get(bat_priv, 0); if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { batadv_softif_destroy_vlan(bat_priv, vlan); batadv_softif_vlan_free_ref(vlan); } else { } batadv_sysfs_del_meshif(soft_iface); unregister_netdev(soft_iface); return; } } static int batadv_softif_init_late(struct net_device *dev ) { struct batadv_priv *bat_priv ; uint32_t random_seqno ; int ret ; size_t cnt_len ; void *tmp ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; void *tmp___0 ; { cnt_len = 296UL; batadv_set_lockdep_class(dev); tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; bat_priv->soft_iface = dev; __init_work(& bat_priv->cleanup_work, 0); __constr_expr_0.counter = 137438953408L; bat_priv->cleanup_work.data = __constr_expr_0; lockdep_init_map(& bat_priv->cleanup_work.lockdep_map, "(&bat_priv->cleanup_work)", & __key, 0); INIT_LIST_HEAD(& bat_priv->cleanup_work.entry); bat_priv->cleanup_work.func = & batadv_softif_destroy_finish; tmp___0 = __alloc_percpu(cnt_len, 8UL); bat_priv->bat_counters = (uint64_t *)tmp___0; if ((unsigned long )bat_priv->bat_counters == (unsigned long )((uint64_t *)0ULL)) { return (-12); } else { } atomic_set(& bat_priv->aggregated_ogms, 1); atomic_set(& bat_priv->bonding, 0); atomic_set(& bat_priv->bridge_loop_avoidance, 0); atomic_set(& bat_priv->distributed_arp_table, 1); bat_priv->mcast.flags = 0U; atomic_set(& bat_priv->multicast_mode, 1); atomic_set(& bat_priv->mcast.num_disabled, 0); atomic_set(& bat_priv->mcast.num_want_all_unsnoopables, 0); atomic_set(& bat_priv->mcast.num_want_all_ipv4, 0); atomic_set(& bat_priv->mcast.num_want_all_ipv6, 0); atomic_set(& bat_priv->gw_mode, 0); atomic_set(& bat_priv->gw_sel_class, 20); atomic_set(& bat_priv->gw.bandwidth_down, 100); atomic_set(& bat_priv->gw.bandwidth_up, 20); atomic_set(& bat_priv->orig_interval, 1000); atomic_set(& bat_priv->hop_penalty, 15); atomic_set(& bat_priv->log_level, 0); atomic_set(& bat_priv->fragmentation, 1); atomic_set(& bat_priv->packet_size_max, 1500); atomic_set(& bat_priv->bcast_queue_left, 256); atomic_set(& bat_priv->batman_queue_left, 256); atomic_set(& bat_priv->mesh_state, 0); atomic_set(& bat_priv->bcast_seqno, 1); atomic_set(& bat_priv->tt.vn, 0); atomic_set(& bat_priv->tt.local_changes, 0); atomic_set(& bat_priv->tt.ogm_append_cnt, 0); atomic_set(& bat_priv->bla.num_requests, 0); bat_priv->tt.last_changeset = (unsigned char *)0U; bat_priv->tt.last_changeset_len = 0; bat_priv->isolation_mark = 0U; bat_priv->isolation_mark_mask = 0U; get_random_bytes((void *)(& random_seqno), 4); atomic_set(& bat_priv->frag_seqno, (int )random_seqno); bat_priv->primary_if = (struct batadv_hard_iface *)0; bat_priv->num_ifaces = 0; batadv_nc_init_bat_priv(bat_priv); ret = batadv_algo_select(bat_priv, (char *)(& batadv_routing_algo)); if (ret < 0) { goto free_bat_counters; } else { } ret = batadv_debugfs_add_meshif(dev); if (ret < 0) { goto free_bat_counters; } else { } ret = batadv_mesh_init(dev); if (ret < 0) { goto unreg_debugfs; } else { } return (0); unreg_debugfs: batadv_debugfs_del_meshif(dev); free_bat_counters: free_percpu((void *)bat_priv->bat_counters); bat_priv->bat_counters = (uint64_t *)0ULL; return (ret); } } static int batadv_softif_slave_add(struct net_device *dev , struct net_device *slave_dev ) { struct batadv_hard_iface *hard_iface ; int ret ; { ret = -22; hard_iface = batadv_hardif_get_by_netdev((struct net_device const *)slave_dev); if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0) || (unsigned long )hard_iface->soft_iface != (unsigned long )((struct net_device *)0)) { goto out; } else { } ret = batadv_hardif_enable_interface(hard_iface, (char const *)(& dev->name)); out: ; if ((unsigned long )hard_iface != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(hard_iface); } else { } return (ret); } } static int batadv_softif_slave_del(struct net_device *dev , struct net_device *slave_dev ) { struct batadv_hard_iface *hard_iface ; int ret ; { ret = -22; hard_iface = batadv_hardif_get_by_netdev((struct net_device const *)slave_dev); if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0) || (unsigned long )hard_iface->soft_iface != (unsigned long )dev) { goto out; } else { } batadv_hardif_disable_interface(hard_iface, 0); ret = 0; out: ; if ((unsigned long )hard_iface != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(hard_iface); } else { } return (ret); } } static struct net_device_ops const batadv_netdev_ops = {& batadv_softif_init_late, 0, & batadv_interface_open, & batadv_interface_release, (netdev_tx_t (*)(struct sk_buff * , struct net_device * ))(& batadv_interface_tx), 0, 0, & batadv_interface_set_rx_mode, & batadv_interface_set_mac_addr, & eth_validate_addr, 0, 0, & batadv_interface_change_mtu, 0, 0, 0, & batadv_interface_stats, & batadv_interface_add_vid, & batadv_interface_kill_vid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & batadv_softif_slave_add, & batadv_softif_slave_del, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static void batadv_softif_free(struct net_device *dev ) { { batadv_debugfs_del_meshif(dev); batadv_mesh_free(dev); rcu_barrier(); free_netdev(dev); return; } } static void batadv_softif_init_early(struct net_device *dev ) { struct batadv_priv *priv ; void *tmp ; int tmp___0 ; { tmp = netdev_priv((struct net_device const *)dev); priv = (struct batadv_priv *)tmp; ether_setup(dev); dev->netdev_ops = & batadv_netdev_ops; dev->destructor = & batadv_softif_free; dev->features = dev->features | 512ULL; dev->tx_queue_len = 0UL; dev->mtu = 1500U; tmp___0 = batadv_max_header_len(); dev->hard_header_len = (unsigned short )tmp___0; eth_hw_addr_random(dev); dev->ethtool_ops = & batadv_ethtool_ops; memset((void *)priv, 0, 3200UL); return; } } struct net_device *batadv_softif_create(char const *name ) { struct net_device *soft_iface ; int ret ; { soft_iface = alloc_netdev_mqs(3200, name, & batadv_softif_init_early, 1U, 1U); if ((unsigned long )soft_iface == (unsigned long )((struct net_device *)0)) { return ((struct net_device *)0); } else { } soft_iface->rtnl_link_ops = (struct rtnl_link_ops const *)(& batadv_link_ops); ret = register_netdevice(soft_iface); if (ret < 0) { printk("\vbatman_adv: Unable to register the batman interface \'%s\': %i\n", name, ret); free_netdev(soft_iface); return ((struct net_device *)0); } else { } return (soft_iface); } } void batadv_softif_destroy_sysfs(struct net_device *soft_iface ) { struct batadv_priv *bat_priv ; void *tmp ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; queue_work(batadv_event_workqueue, & bat_priv->cleanup_work); return; } } static void batadv_softif_destroy_netlink(struct net_device *soft_iface , struct list_head *head ) { struct batadv_hard_iface *hard_iface ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)batadv_hardif_list.next; hard_iface = (struct batadv_hard_iface *)__mptr; goto ldv_50231; ldv_50230: ; if ((unsigned long )hard_iface->soft_iface == (unsigned long )soft_iface) { batadv_hardif_disable_interface(hard_iface, 0); } else { } __mptr___0 = (struct list_head const *)hard_iface->list.next; hard_iface = (struct batadv_hard_iface *)__mptr___0; ldv_50231: ; if ((unsigned long )(& hard_iface->list) != (unsigned long )(& batadv_hardif_list)) { goto ldv_50230; } else { } batadv_sysfs_del_meshif(soft_iface); unregister_netdevice_queue(soft_iface, head); return; } } int batadv_softif_is_valid(struct net_device const *net_dev ) { { if ((unsigned long )((netdev_tx_t (*)(struct sk_buff * , struct net_device * ))(net_dev->netdev_ops)->ndo_start_xmit) == (unsigned long )((netdev_tx_t (*)(struct sk_buff * , struct net_device * ))(& batadv_interface_tx))) { return (1); } else { } return (0); } } struct rtnl_link_ops batadv_link_ops = {{0, 0}, "batadv", 3200UL, & batadv_softif_init_early, 0, 0, 0, 0, 0, & batadv_softif_destroy_netlink, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static int batadv_get_settings(struct net_device *dev , struct ethtool_cmd *cmd ) { { cmd->supported = 0U; cmd->advertising = 0U; ethtool_cmd_speed_set(cmd, 10U); cmd->duplex = 1U; cmd->port = 0U; cmd->phy_address = 0U; cmd->transceiver = 0U; cmd->autoneg = 0U; cmd->maxtxpkt = 0U; cmd->maxrxpkt = 0U; return (0); } } static void batadv_get_drvinfo(struct net_device *dev , struct ethtool_drvinfo *info ) { { strlcpy((char *)(& info->driver), "B.A.T.M.A.N. advanced", 32UL); strlcpy((char *)(& info->version), "2014.3.0", 32UL); strlcpy((char *)(& info->fw_version), "N/A", 32UL); strlcpy((char *)(& info->bus_info), "batman", 32UL); return; } } static u32 batadv_get_msglevel(struct net_device *dev ) { { return (4294967201U); } } static void batadv_set_msglevel(struct net_device *dev , u32 value ) { { return; } } static u32 batadv_get_link(struct net_device *dev ) { { return (1U); } } static struct __anonstruct_batadv_counters_strings_279 const batadv_counters_strings[37U] = { {{'t', 'x', '\000'}}, {{'t', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'t', 'x', '_', 'd', 'r', 'o', 'p', 'p', 'e', 'd', '\000'}}, {{'r', 'x', '\000'}}, {{'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'f', 'o', 'r', 'w', 'a', 'r', 'd', '\000'}}, {{'f', 'o', 'r', 'w', 'a', 'r', 'd', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'m', 'g', 'm', 't', '_', 't', 'x', '\000'}}, {{'m', 'g', 'm', 't', '_', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'m', 'g', 'm', 't', '_', 'r', 'x', '\000'}}, {{'m', 'g', 'm', 't', '_', 'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'f', 'r', 'a', 'g', '_', 't', 'x', '\000'}}, {{'f', 'r', 'a', 'g', '_', 't', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'f', 'r', 'a', 'g', '_', 'r', 'x', '\000'}}, {{'f', 'r', 'a', 'g', '_', 'r', 'x', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'f', 'r', 'a', 'g', '_', 'f', 'w', 'd', '\000'}}, {{'f', 'r', 'a', 'g', '_', 'f', 'w', 'd', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'t', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 't', 'x', '\000'}}, {{'t', 't', '_', 'r', 'e', 'q', 'u', 'e', 's', 't', '_', 'r', 'x', '\000'}}, {{'t', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 't', 'x', '\000'}}, {{'t', 't', '_', 'r', 'e', 's', 'p', 'o', 'n', 's', 'e', '_', 'r', 'x', '\000'}}, {{'t', 't', '_', 'r', 'o', 'a', 'm', '_', 'a', 'd', 'v', '_', 't', 'x', '\000'}}, {{'t', 't', '_', 'r', 'o', 'a', 'm', '_', 'a', 'd', 'v', '_', 'r', 'x', '\000'}}, {{'d', 'a', 't', '_', 'g', 'e', 't', '_', 't', 'x', '\000'}}, {{'d', 'a', 't', '_', 'g', 'e', 't', '_', 'r', 'x', '\000'}}, {{'d', 'a', 't', '_', 'p', 'u', 't', '_', 't', 'x', '\000'}}, {{'d', 'a', 't', '_', 'p', 'u', 't', '_', 'r', 'x', '\000'}}, {{'d', 'a', 't', '_', 'c', 'a', 'c', 'h', 'e', 'd', '_', 'r', 'e', 'p', 'l', 'y', '_', 't', 'x', '\000'}}, {{'n', 'c', '_', 'c', 'o', 'd', 'e', '\000'}}, {{'n', 'c', '_', 'c', 'o', 'd', 'e', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'n', 'c', '_', 'r', 'e', 'c', 'o', 'd', 'e', '\000'}}, {{'n', 'c', '_', 'r', 'e', 'c', 'o', 'd', 'e', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'n', 'c', '_', 'b', 'u', 'f', 'f', 'e', 'r', '\000'}}, {{'n', 'c', '_', 'd', 'e', 'c', 'o', 'd', 'e', '\000'}}, {{'n', 'c', '_', 'd', 'e', 'c', 'o', 'd', 'e', '_', 'b', 'y', 't', 'e', 's', '\000'}}, {{'n', 'c', '_', 'd', 'e', 'c', 'o', 'd', 'e', '_', 'f', 'a', 'i', 'l', 'e', 'd', '\000'}}, {{'n', 'c', '_', 's', 'n', 'i', 'f', 'f', 'e', 'd', '\000'}}}; static void batadv_get_strings(struct net_device *dev , unsigned int stringset , unsigned char *data ) { size_t __len ; void *__ret ; { if (stringset == 1U) { __len = 1184UL; if (__len > 63UL) { __ret = __memcpy((void *)data, (void const *)(& batadv_counters_strings), __len); } else { __ret = __builtin_memcpy((void *)data, (void const *)(& batadv_counters_strings), __len); } } else { } return; } } static void batadv_get_ethtool_stats(struct net_device *dev , struct ethtool_stats *stats , unsigned long long *data ) { struct batadv_priv *bat_priv ; void *tmp ; int i ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; i = 0; goto ldv_50274; ldv_50273: *(data + (unsigned long )i) = batadv_sum_counter(bat_priv, (size_t )i); i = i + 1; ldv_50274: ; if (i <= 36) { goto ldv_50273; } else { } return; } } static int batadv_get_sset_count(struct net_device *dev , int stringset ) { { if (stringset == 1) { return (37); } else { } return (-95); } } extern int ldv_release_19(void) ; extern int ldv_ndo_uninit_20(void) ; int ldv_retval_8 ; int ldv_retval_7 ; extern int ldv_init_19(void) ; void ldv_net_device_ops_20(void) { void *tmp ; { tmp = ldv_zalloc(3264UL); batadv_netdev_ops_group1 = (struct net_device *)tmp; return; } } void ldv_initialize_ethtool_ops_21(void) { void *tmp ; { tmp = ldv_zalloc(3264UL); batadv_ethtool_ops_group0 = (struct net_device *)tmp; return; } } void ldv_initialize_rtnl_link_ops_19(void) { void *tmp ; { tmp = ldv_zalloc(3264UL); batadv_link_ops_group0 = (struct net_device *)tmp; return; } } void ldv_main_exported_21(void) { u8 *ldvarg10 ; void *tmp ; struct ethtool_stats *ldvarg13 ; void *tmp___0 ; struct ethtool_cmd *ldvarg17 ; void *tmp___1 ; u32 ldvarg14 ; u32 tmp___2 ; struct ethtool_drvinfo *ldvarg15 ; void *tmp___3 ; int ldvarg16 ; int tmp___4 ; u64 *ldvarg12 ; void *tmp___5 ; u32 ldvarg11 ; u32 tmp___6 ; int tmp___7 ; { tmp = ldv_zalloc(1UL); ldvarg10 = (u8 *)tmp; tmp___0 = ldv_zalloc(8UL); ldvarg13 = (struct ethtool_stats *)tmp___0; tmp___1 = ldv_zalloc(44UL); ldvarg17 = (struct ethtool_cmd *)tmp___1; tmp___2 = __VERIFIER_nondet_u32(); ldvarg14 = tmp___2; tmp___3 = ldv_zalloc(196UL); ldvarg15 = (struct ethtool_drvinfo *)tmp___3; tmp___4 = __VERIFIER_nondet_int(); ldvarg16 = tmp___4; tmp___5 = ldv_zalloc(8UL); ldvarg12 = (u64 *)tmp___5; tmp___6 = __VERIFIER_nondet_u32(); ldvarg11 = tmp___6; tmp___7 = __VERIFIER_nondet_int(); switch (tmp___7) { case 0: ; if (ldv_state_variable_21 == 1) { batadv_get_settings(batadv_ethtool_ops_group0, ldvarg17); ldv_state_variable_21 = 1; } else { } goto ldv_50309; case 1: ; if (ldv_state_variable_21 == 1) { batadv_get_sset_count(batadv_ethtool_ops_group0, ldvarg16); ldv_state_variable_21 = 1; } else { } goto ldv_50309; case 2: ; if (ldv_state_variable_21 == 1) { batadv_get_drvinfo(batadv_ethtool_ops_group0, ldvarg15); ldv_state_variable_21 = 1; } else { } goto ldv_50309; case 3: ; if (ldv_state_variable_21 == 1) { batadv_set_msglevel(batadv_ethtool_ops_group0, ldvarg14); ldv_state_variable_21 = 1; } else { } goto ldv_50309; case 4: ; if (ldv_state_variable_21 == 1) { batadv_get_ethtool_stats(batadv_ethtool_ops_group0, ldvarg13, ldvarg12); ldv_state_variable_21 = 1; } else { } goto ldv_50309; case 5: ; if (ldv_state_variable_21 == 1) { batadv_get_strings(batadv_ethtool_ops_group0, ldvarg11, ldvarg10); ldv_state_variable_21 = 1; } else { } goto ldv_50309; case 6: ; if (ldv_state_variable_21 == 1) { batadv_get_msglevel(batadv_ethtool_ops_group0); ldv_state_variable_21 = 1; } else { } goto ldv_50309; case 7: ; if (ldv_state_variable_21 == 1) { batadv_get_link(batadv_ethtool_ops_group0); ldv_state_variable_21 = 1; } else { } goto ldv_50309; default: ldv_stop(); } ldv_50309: ; return; } } void ldv_main_exported_19(void) { struct list_head *ldvarg142 ; void *tmp ; int tmp___0 ; { tmp = ldv_zalloc(16UL); ldvarg142 = (struct list_head *)tmp; tmp___0 = __VERIFIER_nondet_int(); switch (tmp___0) { case 0: ; if (ldv_state_variable_19 == 1) { batadv_softif_init_early(batadv_link_ops_group0); ldv_state_variable_19 = 2; ref_cnt = ref_cnt + 1; } else { } goto ldv_50323; case 1: ; if (ldv_state_variable_19 == 1) { batadv_softif_destroy_netlink(batadv_link_ops_group0, ldvarg142); ldv_state_variable_19 = 1; } else { } if (ldv_state_variable_19 == 3) { batadv_softif_destroy_netlink(batadv_link_ops_group0, ldvarg142); ldv_state_variable_19 = 3; } else { } if (ldv_state_variable_19 == 2) { batadv_softif_destroy_netlink(batadv_link_ops_group0, ldvarg142); ldv_state_variable_19 = 2; } else { } goto ldv_50323; case 2: ; if (ldv_state_variable_19 == 3) { ldv_release_19(); ldv_state_variable_19 = 1; ref_cnt = ref_cnt - 1; } else { } if (ldv_state_variable_19 == 2) { ldv_release_19(); ldv_state_variable_19 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50323; case 3: ; if (ldv_state_variable_19 == 2) { ldv_init_19(); ldv_state_variable_19 = 3; } else { } goto ldv_50323; default: ldv_stop(); } ldv_50323: ; return; } } void ldv_main_exported_20(void) { struct sk_buff *ldvarg62 ; void *tmp ; u16 ldvarg64 ; u16 tmp___0 ; u16 ldvarg66 ; u16 tmp___1 ; __be16 ldvarg67 ; void *ldvarg61 ; void *tmp___2 ; int ldvarg63 ; int tmp___3 ; __be16 ldvarg65 ; int tmp___4 ; { tmp = ldv_zalloc(232UL); ldvarg62 = (struct sk_buff *)tmp; tmp___0 = __VERIFIER_nondet_u16(); ldvarg64 = tmp___0; tmp___1 = __VERIFIER_nondet_u16(); ldvarg66 = tmp___1; tmp___2 = ldv_zalloc(1UL); ldvarg61 = tmp___2; tmp___3 = __VERIFIER_nondet_int(); ldvarg63 = tmp___3; memset((void *)(& ldvarg67), 0, 2UL); memset((void *)(& ldvarg65), 0, 2UL); tmp___4 = __VERIFIER_nondet_int(); switch (tmp___4) { case 0: ; if (ldv_state_variable_20 == 3) { batadv_interface_release(batadv_netdev_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 1: ; if (ldv_state_variable_20 == 1) { batadv_interface_set_rx_mode(batadv_netdev_ops_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { batadv_interface_set_rx_mode(batadv_netdev_ops_group1); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_interface_set_rx_mode(batadv_netdev_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 2: ; if (ldv_state_variable_20 == 1) { eth_validate_addr(batadv_netdev_ops_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { eth_validate_addr(batadv_netdev_ops_group1); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { eth_validate_addr(batadv_netdev_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 3: ; if (ldv_state_variable_20 == 1) { batadv_softif_slave_add(batadv_netdev_ops_group1, batadv_netdev_ops_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { batadv_softif_slave_add(batadv_netdev_ops_group1, batadv_netdev_ops_group1); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_softif_slave_add(batadv_netdev_ops_group1, batadv_netdev_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 4: ; if (ldv_state_variable_20 == 1) { batadv_interface_kill_vid(batadv_netdev_ops_group1, (int )ldvarg67, (int )ldvarg66); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { batadv_interface_kill_vid(batadv_netdev_ops_group1, (int )ldvarg67, (int )ldvarg66); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_interface_kill_vid(batadv_netdev_ops_group1, (int )ldvarg67, (int )ldvarg66); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 5: ; if (ldv_state_variable_20 == 1) { batadv_interface_add_vid(batadv_netdev_ops_group1, (int )ldvarg65, (int )ldvarg64); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { batadv_interface_add_vid(batadv_netdev_ops_group1, (int )ldvarg65, (int )ldvarg64); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_interface_add_vid(batadv_netdev_ops_group1, (int )ldvarg65, (int )ldvarg64); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 6: ; if (ldv_state_variable_20 == 1) { batadv_interface_stats(batadv_netdev_ops_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { batadv_interface_stats(batadv_netdev_ops_group1); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_interface_stats(batadv_netdev_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 7: ; if (ldv_state_variable_20 == 1) { batadv_softif_slave_del(batadv_netdev_ops_group1, batadv_netdev_ops_group1); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { batadv_softif_slave_del(batadv_netdev_ops_group1, batadv_netdev_ops_group1); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_softif_slave_del(batadv_netdev_ops_group1, batadv_netdev_ops_group1); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 8: ; if (ldv_state_variable_20 == 3) { batadv_interface_change_mtu(batadv_netdev_ops_group1, ldvarg63); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_interface_change_mtu(batadv_netdev_ops_group1, ldvarg63); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 9: ; if (ldv_state_variable_20 == 2) { ldv_retval_8 = batadv_interface_open(batadv_netdev_ops_group1); if (ldv_retval_8 == 0) { ldv_state_variable_20 = 3; } else { } } else { } goto ldv_50339; case 10: ; if (ldv_state_variable_20 == 3) { batadv_interface_tx(ldvarg62, batadv_netdev_ops_group1); ldv_state_variable_20 = 3; } else { } goto ldv_50339; case 11: ; if (ldv_state_variable_20 == 1) { batadv_interface_set_mac_addr(batadv_netdev_ops_group1, ldvarg61); ldv_state_variable_20 = 1; } else { } if (ldv_state_variable_20 == 3) { batadv_interface_set_mac_addr(batadv_netdev_ops_group1, ldvarg61); ldv_state_variable_20 = 3; } else { } if (ldv_state_variable_20 == 2) { batadv_interface_set_mac_addr(batadv_netdev_ops_group1, ldvarg61); ldv_state_variable_20 = 2; } else { } goto ldv_50339; case 12: ; if (ldv_state_variable_20 == 1) { ldv_retval_7 = batadv_softif_init_late(batadv_netdev_ops_group1); if (ldv_retval_7 == 0) { ldv_state_variable_20 = 2; ref_cnt = ref_cnt + 1; } else { } } else { } goto ldv_50339; case 13: ; if (ldv_state_variable_20 == 2) { ldv_ndo_uninit_20(); ldv_state_variable_20 = 1; ref_cnt = ref_cnt - 1; } else { } goto ldv_50339; default: ldv_stop(); } ldv_50339: ; return; } } void *ldv_kmem_cache_alloc_734(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_740(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_742(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_744(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_745(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_746(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_747(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_748(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_749(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_750(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_751(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } extern int kstrtoull(char const * , unsigned int , unsigned long long * ) ; __inline static int kstrtoul(char const *s , unsigned int base , unsigned long *res ) { int tmp ; { tmp = kstrtoull(s, base, (unsigned long long *)res); return (tmp); } } extern int kstrtouint(char const * , unsigned int , unsigned int * ) ; __inline static int kstrtou32(char const *s , unsigned int base , u32 *res ) { int tmp ; { tmp = kstrtouint(s, base, res); return (tmp); } } extern int strncmp(char const * , char const * , __kernel_size_t ) ; extern int sysfs_create_file_ns(struct kobject * , struct attribute const * , void const * ) ; extern void sysfs_remove_file_ns(struct kobject * , struct attribute const * , void const * ) ; __inline static int sysfs_create_file(struct kobject *kobj , struct attribute const *attr ) { int tmp ; { tmp = sysfs_create_file_ns(kobj, attr, (void const *)0); return (tmp); } } __inline static void sysfs_remove_file(struct kobject *kobj , struct attribute const *attr ) { { sysfs_remove_file_ns(kobj, attr, (void const *)0); return; } } extern struct kobject *kobject_create_and_add(char const * , struct kobject * ) ; extern struct kobject *kobject_get(struct kobject * ) ; extern void kobject_put(struct kobject * ) ; extern int kobject_uevent_env(struct kobject * , enum kobject_action , char ** ) ; void *ldv_kmem_cache_alloc_778(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_795(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_786(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_794(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_788(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_784(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_792(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_793(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_789(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_790(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_791(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; static struct net_device *batadv_kobj_to_netdev(struct kobject *obj ) { struct device *dev ; struct kobject const *__mptr ; struct device const *__mptr___0 ; { __mptr = (struct kobject const *)obj->parent; dev = (struct device *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct device const *)dev; return ((struct net_device *)__mptr___0 + 0xfffffffffffffac8UL); } } static struct batadv_priv *batadv_kobj_to_batpriv(struct kobject *obj ) { struct net_device *net_dev ; struct net_device *tmp ; void *tmp___0 ; { tmp = batadv_kobj_to_netdev(obj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); return ((struct batadv_priv *)tmp___0); } } static struct batadv_priv *batadv_vlan_kobj_to_batpriv(struct kobject *obj ) { struct batadv_priv *tmp ; int tmp___0 ; struct batadv_priv *tmp___1 ; { tmp___0 = strcmp("mesh", obj->name); if (tmp___0 == 0) { tmp = batadv_kobj_to_batpriv(obj); return (tmp); } else { } tmp___1 = batadv_kobj_to_batpriv(obj->parent); return (tmp___1); } } static struct batadv_softif_vlan *batadv_kobj_to_vlan(struct batadv_priv *bat_priv , struct kobject *obj ) { struct batadv_softif_vlan *vlan_tmp ; struct batadv_softif_vlan *vlan ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_softif_vlan *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_softif_vlan *tmp___3 ; { vlan = (struct batadv_softif_vlan *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->softif_vlan_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_softif_vlan *)__mptr + 0xffffffffffffffe0UL; } else { tmp___0 = (struct batadv_softif_vlan *)0; } vlan_tmp = tmp___0; goto ldv_49883; ldv_49882: ; if ((unsigned long )vlan_tmp->kobj != (unsigned long )obj) { goto ldv_49880; } else { } tmp___1 = atomic_add_unless(& vlan_tmp->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_49880; } else { } vlan = vlan_tmp; goto ldv_49881; ldv_49880: _________p1___0 = *((struct hlist_node * volatile *)(& vlan_tmp->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_softif_vlan *)__mptr___0 + 0xffffffffffffffe0UL; } else { tmp___3 = (struct batadv_softif_vlan *)0; } vlan_tmp = tmp___3; ldv_49883: ; if ((unsigned long )vlan_tmp != (unsigned long )((struct batadv_softif_vlan *)0)) { goto ldv_49882; } else { } ldv_49881: rcu_read_unlock(); return (vlan); } } static char *batadv_uev_action_str[3U] = { (char *)"add", (char *)"del", (char *)"change"}; static char *batadv_uev_type_str[1U] = { (char *)"gw"}; static int batadv_store_bool_attr(char *buff , size_t count , struct net_device *net_dev , char const *attr_name , atomic_t *attr ) { int enabled ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___5 ; int tmp___6 ; int tmp___7 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___8 ; int tmp___9 ; int tmp___10 ; int tmp___11 ; { enabled = -1; if ((int )((signed char )*(buff + (count + 0xffffffffffffffffUL))) == 10) { *(buff + (count + 0xffffffffffffffffUL)) = 0; } else { } tmp = strncmp((char const *)buff, "1", 2UL); if (tmp == 0) { enabled = 1; } else { tmp___0 = strncmp((char const *)buff, "enable", 7UL); if (tmp___0 == 0) { enabled = 1; } else { tmp___1 = strncmp((char const *)buff, "enabled", 8UL); if (tmp___1 == 0) { enabled = 1; } else { } } } tmp___2 = strncmp((char const *)buff, "0", 2UL); if (tmp___2 == 0) { enabled = 0; } else { tmp___3 = strncmp((char const *)buff, "disable", 8UL); if (tmp___3 == 0) { enabled = 0; } else { tmp___4 = strncmp((char const *)buff, "disabled", 9UL); if (tmp___4 == 0) { enabled = 0; } else { } } } if (enabled < 0) { _netdev = net_dev; tmp___5 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___5; tmp___6 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___6 & 63) != 0) { batadv_debug_log(_batpriv, "%s: Invalid parameter received: %s\n", attr_name, buff); } else { } printk("\016batman_adv: %s: %s: Invalid parameter received: %s\n", (char *)(& _netdev->name), attr_name, buff); return (-22); } else { } tmp___7 = atomic_read((atomic_t const *)attr); if (tmp___7 == enabled) { return ((int )count); } else { } _netdev___0 = net_dev; tmp___8 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___8; tmp___10 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___10 & 63) != 0) { tmp___9 = atomic_read((atomic_t const *)attr); batadv_debug_log(_batpriv___0, "%s: Changing from: %s to: %s\n", attr_name, tmp___9 == 1 ? (char *)"enabled" : (char *)"disabled", enabled == 1 ? (char *)"enabled" : (char *)"disabled"); } else { } tmp___11 = atomic_read((atomic_t const *)attr); printk("\016batman_adv: %s: %s: Changing from: %s to: %s\n", (char *)(& _netdev___0->name), attr_name, tmp___11 == 1 ? (char *)"enabled" : (char *)"disabled", enabled == 1 ? (char *)"enabled" : (char *)"disabled"); atomic_set(attr, enabled); return ((int )count); } } __inline static ssize_t __batadv_store_bool_attr(char *buff , size_t count , void (*post_func)(struct net_device * ) , struct attribute *attr , atomic_t *attr_store , struct net_device *net_dev ) { int ret ; { ret = batadv_store_bool_attr(buff, count, net_dev, attr->name, attr_store); if ((unsigned long )post_func != (unsigned long )((void (*)(struct net_device * ))0) && ret != 0) { (*post_func)(net_dev); } else { } return ((ssize_t )ret); } } static int batadv_store_uint_attr(char const *buff , size_t count , struct net_device *net_dev , char const *attr_name , unsigned int min , unsigned int max , atomic_t *attr ) { unsigned long uint_val ; int ret ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp ; int tmp___0 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___1 ; int tmp___2 ; struct net_device *_netdev___1 ; struct batadv_priv *_batpriv___1 ; void *tmp___3 ; int tmp___4 ; int tmp___5 ; struct net_device *_netdev___2 ; struct batadv_priv *_batpriv___2 ; void *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; { ret = kstrtoul(buff, 10U, & uint_val); if (ret != 0) { _netdev = net_dev; tmp = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp; tmp___0 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___0 & 63) != 0) { batadv_debug_log(_batpriv, "%s: Invalid parameter received: %s\n", attr_name, buff); } else { } printk("\016batman_adv: %s: %s: Invalid parameter received: %s\n", (char *)(& _netdev->name), attr_name, buff); return (-22); } else { } if ((unsigned long )min > uint_val) { _netdev___0 = net_dev; tmp___1 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___1; tmp___2 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___2 & 63) != 0) { batadv_debug_log(_batpriv___0, "%s: Value is too small: %lu min: %u\n", attr_name, uint_val, min); } else { } printk("\016batman_adv: %s: %s: Value is too small: %lu min: %u\n", (char *)(& _netdev___0->name), attr_name, uint_val, min); return (-22); } else { } if ((unsigned long )max < uint_val) { _netdev___1 = net_dev; tmp___3 = netdev_priv((struct net_device const *)_netdev___1); _batpriv___1 = (struct batadv_priv *)tmp___3; tmp___4 = atomic_read((atomic_t const *)(& _batpriv___1->log_level)); if ((tmp___4 & 63) != 0) { batadv_debug_log(_batpriv___1, "%s: Value is too big: %lu max: %u\n", attr_name, uint_val, max); } else { } printk("\016batman_adv: %s: %s: Value is too big: %lu max: %u\n", (char *)(& _netdev___1->name), attr_name, uint_val, max); return (-22); } else { } tmp___5 = atomic_read((atomic_t const *)attr); if ((unsigned long )tmp___5 == uint_val) { return ((int )count); } else { } _netdev___2 = net_dev; tmp___6 = netdev_priv((struct net_device const *)_netdev___2); _batpriv___2 = (struct batadv_priv *)tmp___6; tmp___8 = atomic_read((atomic_t const *)(& _batpriv___2->log_level)); if ((tmp___8 & 63) != 0) { tmp___7 = atomic_read((atomic_t const *)attr); batadv_debug_log(_batpriv___2, "%s: Changing from: %i to: %lu\n", attr_name, tmp___7, uint_val); } else { } tmp___9 = atomic_read((atomic_t const *)attr); printk("\016batman_adv: %s: %s: Changing from: %i to: %lu\n", (char *)(& _netdev___2->name), attr_name, tmp___9, uint_val); atomic_set(attr, (int )uint_val); return ((int )count); } } __inline static ssize_t __batadv_store_uint_attr(char const *buff , size_t count , int min , int max , void (*post_func)(struct net_device * ) , struct attribute const *attr , atomic_t *attr_store , struct net_device *net_dev ) { int ret ; { ret = batadv_store_uint_attr(buff, count, net_dev, attr->name, (unsigned int )min, (unsigned int )max, attr_store); if ((unsigned long )post_func != (unsigned long )((void (*)(struct net_device * ))0) && ret != 0) { (*post_func)(net_dev); } else { } return ((ssize_t )ret); } } static ssize_t batadv_show_bat_algo(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = sprintf(buff, "%s\n", (bat_priv->bat_algo_ops)->name); return ((ssize_t )tmp___0); } } static void batadv_post_gw_reselect(struct net_device *net_dev ) { struct batadv_priv *bat_priv ; void *tmp ; { tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; batadv_gw_reselect(bat_priv); return; } } static ssize_t batadv_show_gw_mode(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int bytes_written ; int tmp___0 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); switch (tmp___0) { case 1: bytes_written = sprintf(buff, "%s\n", (char *)"client"); goto ldv_49957; case 2: bytes_written = sprintf(buff, "%s\n", (char *)"server"); goto ldv_49957; default: bytes_written = sprintf(buff, "%s\n", (char *)"off"); goto ldv_49957; } ldv_49957: ; return ((ssize_t )bytes_written); } } static ssize_t batadv_store_gw_mode(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; char *curr_gw_mode_str ; int gw_mode_tmp ; size_t tmp___1 ; int tmp___2 ; size_t tmp___3 ; int tmp___4 ; size_t tmp___5 ; int tmp___6 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___7 ; int tmp___8 ; int tmp___9 ; int tmp___10 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___11 ; int tmp___12 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; gw_mode_tmp = -1; if ((int )((signed char )*(buff + (count + 0xffffffffffffffffUL))) == 10) { *(buff + (count + 0xffffffffffffffffUL)) = 0; } else { } tmp___1 = strlen("off"); tmp___2 = strncmp((char const *)buff, "off", tmp___1); if (tmp___2 == 0) { gw_mode_tmp = 0; } else { } tmp___3 = strlen("client"); tmp___4 = strncmp((char const *)buff, "client", tmp___3); if (tmp___4 == 0) { gw_mode_tmp = 1; } else { } tmp___5 = strlen("server"); tmp___6 = strncmp((char const *)buff, "server", tmp___5); if (tmp___6 == 0) { gw_mode_tmp = 2; } else { } if (gw_mode_tmp < 0) { _netdev = net_dev; tmp___7 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___7; tmp___8 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___8 & 63) != 0) { batadv_debug_log(_batpriv, "Invalid parameter for \'gw mode\' setting received: %s\n", buff); } else { } printk("\016batman_adv: %s: Invalid parameter for \'gw mode\' setting received: %s\n", (char *)(& _netdev->name), buff); return (-22L); } else { } tmp___9 = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); if (tmp___9 == gw_mode_tmp) { return ((ssize_t )count); } else { } tmp___10 = atomic_read((atomic_t const *)(& bat_priv->gw_mode)); switch (tmp___10) { case 1: curr_gw_mode_str = (char *)"client"; goto ldv_49973; case 2: curr_gw_mode_str = (char *)"server"; goto ldv_49973; default: curr_gw_mode_str = (char *)"off"; goto ldv_49973; } ldv_49973: _netdev___0 = net_dev; tmp___11 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___11; tmp___12 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___12 & 63) != 0) { batadv_debug_log(_batpriv___0, "Changing gw mode from: %s to: %s\n", curr_gw_mode_str, buff); } else { } printk("\016batman_adv: %s: Changing gw mode from: %s to: %s\n", (char *)(& _netdev___0->name), curr_gw_mode_str, buff); batadv_gw_reselect(bat_priv); batadv_gw_check_client_stop(bat_priv); atomic_set(& bat_priv->gw_mode, gw_mode_tmp); batadv_gw_tvlv_container_update(bat_priv); return ((ssize_t )count); } } static ssize_t batadv_show_gw_bwidth(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; uint32_t down___0 ; uint32_t up___0 ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw.bandwidth_down)); down___0 = (uint32_t )tmp___0; tmp___1 = atomic_read((atomic_t const *)(& bat_priv->gw.bandwidth_up)); up___0 = (uint32_t )tmp___1; tmp___2 = sprintf(buff, "%u.%u/%u.%u MBit\n", down___0 / 10U, down___0 % 10U, up___0 / 10U, up___0 % 10U); return ((ssize_t )tmp___2); } } static ssize_t batadv_store_gw_bwidth(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; ssize_t tmp___0 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; if ((int )((signed char )*(buff + (count + 0xffffffffffffffffUL))) == 10) { *(buff + (count + 0xffffffffffffffffUL)) = 0; } else { } tmp___0 = batadv_gw_bandwidth_set(net_dev, buff, count); return (tmp___0); } } static ssize_t batadv_show_isolation_mark(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = sprintf(buff, "%#.8x/%#.8x\n", bat_priv->isolation_mark, bat_priv->isolation_mark_mask); return ((ssize_t )tmp___0); } } static ssize_t batadv_store_isolation_mark(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; uint32_t mark ; uint32_t mask ; char *mask_ptr ; int tmp___1 ; int tmp___2 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___3 ; int tmp___4 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; mask = 4294967295U; mask_ptr = strchr((char const *)buff, 47); if ((unsigned long )mask_ptr != (unsigned long )((char *)0)) { *mask_ptr = 0; mask_ptr = mask_ptr + 1; tmp___1 = kstrtou32((char const *)mask_ptr, 16U, & mask); if (tmp___1 < 0) { return (-22L); } else { } } else { } tmp___2 = kstrtou32((char const *)buff, 0U, & mark); if (tmp___2 < 0) { return (-22L); } else { } bat_priv->isolation_mark_mask = mask; bat_priv->isolation_mark = bat_priv->isolation_mark_mask & mark; _netdev = net_dev; tmp___3 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___3; tmp___4 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___4 & 63) != 0) { batadv_debug_log(_batpriv, "New skb mark for extended isolation: %#.8x/%#.8x\n", bat_priv->isolation_mark, bat_priv->isolation_mark_mask); } else { } printk("\016batman_adv: %s: New skb mark for extended isolation: %#.8x/%#.8x\n", (char *)(& _netdev->name), bat_priv->isolation_mark, bat_priv->isolation_mark_mask); return ((ssize_t )count); } } static ssize_t batadv_store_aggregated_ogms(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, (void (*)(struct net_device * ))0, attr, & bat_priv->aggregated_ogms, net_dev); return (tmp___1); } } static ssize_t batadv_show_aggregated_ogms(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->aggregated_ogms)); tmp___1 = sprintf(buff, "%s\n", tmp___0 == 0 ? (char *)"disabled" : (char *)"enabled"); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_aggregated_ogms = {{"aggregated_ogms", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_aggregated_ogms, & batadv_store_aggregated_ogms}; static ssize_t batadv_store_bonding(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, (void (*)(struct net_device * ))0, attr, & bat_priv->bonding, net_dev); return (tmp___1); } } static ssize_t batadv_show_bonding(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->bonding)); tmp___1 = sprintf(buff, "%s\n", tmp___0 == 0 ? (char *)"disabled" : (char *)"enabled"); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_bonding = {{"bonding", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_bonding, & batadv_store_bonding}; static ssize_t batadv_store_bridge_loop_avoidance(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, (void (*)(struct net_device * ))0, attr, & bat_priv->bridge_loop_avoidance, net_dev); return (tmp___1); } } static ssize_t batadv_show_bridge_loop_avoidance(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->bridge_loop_avoidance)); tmp___1 = sprintf(buff, "%s\n", tmp___0 == 0 ? (char *)"disabled" : (char *)"enabled"); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_bridge_loop_avoidance = {{"bridge_loop_avoidance", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_bridge_loop_avoidance, & batadv_store_bridge_loop_avoidance}; static ssize_t batadv_store_distributed_arp_table(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, & batadv_dat_status_update, attr, & bat_priv->distributed_arp_table, net_dev); return (tmp___1); } } static ssize_t batadv_show_distributed_arp_table(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->distributed_arp_table)); tmp___1 = sprintf(buff, "%s\n", tmp___0 == 0 ? (char *)"disabled" : (char *)"enabled"); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_distributed_arp_table = {{"distributed_arp_table", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_distributed_arp_table, & batadv_store_distributed_arp_table}; static ssize_t batadv_store_fragmentation(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, & batadv_update_min_mtu, attr, & bat_priv->fragmentation, net_dev); return (tmp___1); } } static ssize_t batadv_show_fragmentation(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->fragmentation)); tmp___1 = sprintf(buff, "%s\n", tmp___0 == 0 ? (char *)"disabled" : (char *)"enabled"); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_fragmentation = {{"fragmentation", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_fragmentation, & batadv_store_fragmentation}; static struct batadv_attribute batadv_attr_routing_algo = {{"routing_algo", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_bat_algo, (ssize_t (*)(struct kobject * , struct attribute * , char * , size_t ))0}; static struct batadv_attribute batadv_attr_gw_mode = {{"gw_mode", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_gw_mode, & batadv_store_gw_mode}; static ssize_t batadv_store_orig_interval(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_uint_attr((char const *)buff, count, 40, 2147483647, (void (*)(struct net_device * ))0, (struct attribute const *)attr, & bat_priv->orig_interval, net_dev); return (tmp___1); } } static ssize_t batadv_show_orig_interval(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->orig_interval)); tmp___1 = sprintf(buff, "%i\n", tmp___0); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_orig_interval = {{"orig_interval", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_orig_interval, & batadv_store_orig_interval}; static ssize_t batadv_store_hop_penalty(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_uint_attr((char const *)buff, count, 0, 255, (void (*)(struct net_device * ))0, (struct attribute const *)attr, & bat_priv->hop_penalty, net_dev); return (tmp___1); } } static ssize_t batadv_show_hop_penalty(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->hop_penalty)); tmp___1 = sprintf(buff, "%i\n", tmp___0); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_hop_penalty = {{"hop_penalty", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_hop_penalty, & batadv_store_hop_penalty}; static ssize_t batadv_store_gw_sel_class(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_uint_attr((char const *)buff, count, 1, 255, & batadv_post_gw_reselect, (struct attribute const *)attr, & bat_priv->gw_sel_class, net_dev); return (tmp___1); } } static ssize_t batadv_show_gw_sel_class(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->gw_sel_class)); tmp___1 = sprintf(buff, "%i\n", tmp___0); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_gw_sel_class = {{"gw_sel_class", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_gw_sel_class, & batadv_store_gw_sel_class}; static struct batadv_attribute batadv_attr_gw_bandwidth = {{"gw_bandwidth", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_gw_bwidth, & batadv_store_gw_bwidth}; static ssize_t batadv_store_multicast_mode(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, (void (*)(struct net_device * ))0, attr, & bat_priv->multicast_mode, net_dev); return (tmp___1); } } static ssize_t batadv_show_multicast_mode(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->multicast_mode)); tmp___1 = sprintf(buff, "%s\n", tmp___0 == 0 ? (char *)"disabled" : (char *)"enabled"); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_multicast_mode = {{"multicast_mode", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_multicast_mode, & batadv_store_multicast_mode}; static ssize_t batadv_store_log_level(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_uint_attr((char const *)buff, count, 0, 63, (void (*)(struct net_device * ))0, (struct attribute const *)attr, & bat_priv->log_level, net_dev); return (tmp___1); } } static ssize_t batadv_show_log_level(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); tmp___1 = sprintf(buff, "%i\n", tmp___0); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_log_level = {{"log_level", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_log_level, & batadv_store_log_level}; static ssize_t batadv_store_network_coding(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_priv *bat_priv ; void *tmp___0 ; ssize_t tmp___1 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; tmp___0 = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, & batadv_nc_status_update, attr, & bat_priv->network_coding, net_dev); return (tmp___1); } } static ssize_t batadv_show_network_coding(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; int tmp___0 ; int tmp___1 ; { tmp = batadv_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->network_coding)); tmp___1 = sprintf(buff, "%s\n", tmp___0 == 0 ? (char *)"disabled" : (char *)"enabled"); return ((ssize_t )tmp___1); } } static struct batadv_attribute batadv_attr_network_coding = {{"network_coding", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_network_coding, & batadv_store_network_coding}; static struct batadv_attribute batadv_attr_isolation_mark = {{"isolation_mark", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_isolation_mark, & batadv_store_isolation_mark}; static struct batadv_attribute *batadv_mesh_attrs[16U] = { & batadv_attr_aggregated_ogms, & batadv_attr_bonding, & batadv_attr_bridge_loop_avoidance, & batadv_attr_distributed_arp_table, & batadv_attr_multicast_mode, & batadv_attr_fragmentation, & batadv_attr_routing_algo, & batadv_attr_gw_mode, & batadv_attr_orig_interval, & batadv_attr_hop_penalty, & batadv_attr_gw_sel_class, & batadv_attr_gw_bandwidth, & batadv_attr_log_level, & batadv_attr_network_coding, & batadv_attr_isolation_mark, (struct batadv_attribute *)0}; static ssize_t batadv_store_vlan_ap_isolation(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; struct batadv_softif_vlan *vlan ; struct batadv_softif_vlan *tmp___0 ; size_t res ; ssize_t tmp___1 ; { tmp = batadv_vlan_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = batadv_kobj_to_vlan(bat_priv, kobj); vlan = tmp___0; tmp___1 = __batadv_store_bool_attr(buff, count, (void (*)(struct net_device * ))0, attr, & vlan->ap_isolation, bat_priv->soft_iface); res = (size_t )tmp___1; batadv_softif_vlan_free_ref(vlan); return ((ssize_t )res); } } static ssize_t batadv_show_vlan_ap_isolation(struct kobject *kobj , struct attribute *attr , char *buff ) { struct batadv_priv *bat_priv ; struct batadv_priv *tmp ; struct batadv_softif_vlan *vlan ; struct batadv_softif_vlan *tmp___0 ; size_t res ; int tmp___1 ; int tmp___2 ; { tmp = batadv_vlan_kobj_to_batpriv(kobj); bat_priv = tmp; tmp___0 = batadv_kobj_to_vlan(bat_priv, kobj); vlan = tmp___0; tmp___1 = atomic_read((atomic_t const *)(& vlan->ap_isolation)); tmp___2 = sprintf(buff, "%s\n", tmp___1 == 0 ? (char *)"disabled" : (char *)"enabled"); res = (size_t )tmp___2; batadv_softif_vlan_free_ref(vlan); return ((ssize_t )res); } } static struct batadv_attribute batadv_attr_vlan_ap_isolation = {{"ap_isolation", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_vlan_ap_isolation, & batadv_store_vlan_ap_isolation}; static struct batadv_attribute *batadv_vlan_attrs[2U] = { & batadv_attr_vlan_ap_isolation, (struct batadv_attribute *)0}; int batadv_sysfs_add_meshif(struct net_device *dev ) { struct kobject *batif_kobject ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_attribute **bat_attr ; int err ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___0 ; int tmp___1 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___2 ; int tmp___3 ; { batif_kobject = & dev->dev.kobj; tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; bat_priv->mesh_obj = kobject_create_and_add("mesh", batif_kobject); if ((unsigned long )bat_priv->mesh_obj == (unsigned long )((struct kobject *)0)) { _netdev = dev; tmp___0 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___0; tmp___1 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___1 & 63) != 0) { batadv_debug_log(_batpriv, "Can\'t add sysfs directory: %s/%s\n", (char *)(& dev->name), (char *)"mesh"); } else { } printk("\vbatman_adv: %s: Can\'t add sysfs directory: %s/%s\n", (char *)(& _netdev->name), (char *)(& dev->name), (char *)"mesh"); goto out; } else { } bat_attr = (struct batadv_attribute **)(& batadv_mesh_attrs); goto ldv_50215; ldv_50214: err = sysfs_create_file(bat_priv->mesh_obj, (struct attribute const *)(& (*bat_attr)->attr)); if (err != 0) { _netdev___0 = dev; tmp___2 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___2; tmp___3 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___3 & 63) != 0) { batadv_debug_log(_batpriv___0, "Can\'t add sysfs file: %s/%s/%s\n", (char *)(& dev->name), (char *)"mesh", (*bat_attr)->attr.name); } else { } printk("\vbatman_adv: %s: Can\'t add sysfs file: %s/%s/%s\n", (char *)(& _netdev___0->name), (char *)(& dev->name), (char *)"mesh", (*bat_attr)->attr.name); goto rem_attr; } else { } bat_attr = bat_attr + 1; ldv_50215: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50214; } else { } return (0); rem_attr: bat_attr = (struct batadv_attribute **)(& batadv_mesh_attrs); goto ldv_50218; ldv_50217: sysfs_remove_file(bat_priv->mesh_obj, (struct attribute const *)(& (*bat_attr)->attr)); bat_attr = bat_attr + 1; ldv_50218: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50217; } else { } kobject_put(bat_priv->mesh_obj); bat_priv->mesh_obj = (struct kobject *)0; out: ; return (-12); } } void batadv_sysfs_del_meshif(struct net_device *dev ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_attribute **bat_attr ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; bat_attr = (struct batadv_attribute **)(& batadv_mesh_attrs); goto ldv_50226; ldv_50225: sysfs_remove_file(bat_priv->mesh_obj, (struct attribute const *)(& (*bat_attr)->attr)); bat_attr = bat_attr + 1; ldv_50226: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50225; } else { } kobject_put(bat_priv->mesh_obj); bat_priv->mesh_obj = (struct kobject *)0; return; } } int batadv_sysfs_add_vlan(struct net_device *dev , struct batadv_softif_vlan *vlan ) { char vlan_subdir[10U] ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_attribute **bat_attr ; int err ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___0 ; int tmp___1 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___2 ; int tmp___3 ; { tmp = netdev_priv((struct net_device const *)dev); bat_priv = (struct batadv_priv *)tmp; if ((int )((short )vlan->vid) < 0) { sprintf((char *)(& vlan_subdir), "vlan%hu", (int )vlan->vid & 4095); vlan->kobj = kobject_create_and_add((char const *)(& vlan_subdir), bat_priv->mesh_obj); if ((unsigned long )vlan->kobj == (unsigned long )((struct kobject *)0)) { _netdev = dev; tmp___0 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___0; tmp___1 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___1 & 63) != 0) { batadv_debug_log(_batpriv, "Can\'t add sysfs directory: %s/%s\n", (char *)(& dev->name), (char *)(& vlan_subdir)); } else { } printk("\vbatman_adv: %s: Can\'t add sysfs directory: %s/%s\n", (char *)(& _netdev->name), (char *)(& dev->name), (char *)(& vlan_subdir)); goto out; } else { } } else { vlan->kobj = bat_priv->mesh_obj; kobject_get(bat_priv->mesh_obj); } bat_attr = (struct batadv_attribute **)(& batadv_vlan_attrs); goto ldv_50243; ldv_50242: err = sysfs_create_file(vlan->kobj, (struct attribute const *)(& (*bat_attr)->attr)); if (err != 0) { _netdev___0 = dev; tmp___2 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___2; tmp___3 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___3 & 63) != 0) { batadv_debug_log(_batpriv___0, "Can\'t add sysfs file: %s/%s/%s\n", (char *)(& dev->name), (char *)(& vlan_subdir), (*bat_attr)->attr.name); } else { } printk("\vbatman_adv: %s: Can\'t add sysfs file: %s/%s/%s\n", (char *)(& _netdev___0->name), (char *)(& dev->name), (char *)(& vlan_subdir), (*bat_attr)->attr.name); goto rem_attr; } else { } bat_attr = bat_attr + 1; ldv_50243: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50242; } else { } return (0); rem_attr: bat_attr = (struct batadv_attribute **)(& batadv_vlan_attrs); goto ldv_50246; ldv_50245: sysfs_remove_file(vlan->kobj, (struct attribute const *)(& (*bat_attr)->attr)); bat_attr = bat_attr + 1; ldv_50246: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50245; } else { } kobject_put(vlan->kobj); vlan->kobj = (struct kobject *)0; out: ; return (-12); } } void batadv_sysfs_del_vlan(struct batadv_priv *bat_priv , struct batadv_softif_vlan *vlan ) { struct batadv_attribute **bat_attr ; { bat_attr = (struct batadv_attribute **)(& batadv_vlan_attrs); goto ldv_50254; ldv_50253: sysfs_remove_file(vlan->kobj, (struct attribute const *)(& (*bat_attr)->attr)); bat_attr = bat_attr + 1; ldv_50254: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50253; } else { } kobject_put(vlan->kobj); vlan->kobj = (struct kobject *)0; return; } } static ssize_t batadv_show_mesh_iface(struct kobject *kobj , struct attribute *attr , char *buff ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_hard_iface *hard_iface ; ssize_t length ; char const *ifname ; int tmp___0 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; hard_iface = batadv_hardif_get_by_netdev((struct net_device const *)net_dev); if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0)) { return (0L); } else { } if ((int )((signed char )hard_iface->if_status) == 0) { ifname = "none"; } else { ifname = (char const *)(& (hard_iface->soft_iface)->name); } tmp___0 = sprintf(buff, "%s\n", ifname); length = (ssize_t )tmp___0; batadv_hardif_free_ref(hard_iface); return (length); } } static ssize_t batadv_store_mesh_iface(struct kobject *kobj , struct attribute *attr , char *buff , size_t count ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_hard_iface *hard_iface ; int status_tmp ; int ret ; size_t tmp___0 ; int tmp___1 ; int tmp___2 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; status_tmp = -1; ret = (int )count; hard_iface = batadv_hardif_get_by_netdev((struct net_device const *)net_dev); if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0)) { return ((ssize_t )count); } else { } if ((int )((signed char )*(buff + (count + 0xffffffffffffffffUL))) == 10) { *(buff + (count + 0xffffffffffffffffUL)) = 0; } else { } tmp___0 = strlen((char const *)buff); if (tmp___0 > 15UL) { printk("\vbatman_adv: Invalid parameter for \'mesh_iface\' setting received: interface name too long \'%s\'\n", buff); batadv_hardif_free_ref(hard_iface); return (-22L); } else { } tmp___1 = strncmp((char const *)buff, "none", 4UL); if (tmp___1 == 0) { status_tmp = 0; } else { status_tmp = 5; } if ((int )hard_iface->if_status == status_tmp) { goto out; } else { } if ((unsigned long )hard_iface->soft_iface != (unsigned long )((struct net_device *)0)) { tmp___2 = strncmp((char const *)(& (hard_iface->soft_iface)->name), (char const *)buff, 16UL); if (tmp___2 == 0) { goto out; } else { } } else { } rtnl_lock(); if (status_tmp == 0) { batadv_hardif_disable_interface(hard_iface, 1); goto unlock; } else { } if ((int )((signed char )hard_iface->if_status) != 0) { batadv_hardif_disable_interface(hard_iface, 1); } else { } ret = batadv_hardif_enable_interface(hard_iface, (char const *)buff); unlock: rtnl_unlock(); out: batadv_hardif_free_ref(hard_iface); return ((ssize_t )ret); } } static ssize_t batadv_show_iface_status(struct kobject *kobj , struct attribute *attr , char *buff ) { struct net_device *net_dev ; struct net_device *tmp ; struct batadv_hard_iface *hard_iface ; ssize_t length ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = batadv_kobj_to_netdev(kobj); net_dev = tmp; hard_iface = batadv_hardif_get_by_netdev((struct net_device const *)net_dev); if ((unsigned long )hard_iface == (unsigned long )((struct batadv_hard_iface *)0)) { return (0L); } else { } switch ((int )hard_iface->if_status) { case 1: tmp___0 = sprintf(buff, "disabling\n"); length = (ssize_t )tmp___0; goto ldv_50286; case 2: tmp___1 = sprintf(buff, "inactive\n"); length = (ssize_t )tmp___1; goto ldv_50286; case 3: tmp___2 = sprintf(buff, "active\n"); length = (ssize_t )tmp___2; goto ldv_50286; case 4: tmp___3 = sprintf(buff, "enabling\n"); length = (ssize_t )tmp___3; goto ldv_50286; case 0: ; default: tmp___4 = sprintf(buff, "not in use\n"); length = (ssize_t )tmp___4; goto ldv_50286; } ldv_50286: batadv_hardif_free_ref(hard_iface); return (length); } } static struct batadv_attribute batadv_attr_mesh_iface = {{"mesh_iface", 420U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_mesh_iface, & batadv_store_mesh_iface}; static struct batadv_attribute batadv_attr_iface_status = {{"iface_status", 292U, (_Bool)0, 0, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, & batadv_show_iface_status, (ssize_t (*)(struct kobject * , struct attribute * , char * , size_t ))0}; static struct batadv_attribute *batadv_batman_attrs[3U] = { & batadv_attr_mesh_iface, & batadv_attr_iface_status, (struct batadv_attribute *)0}; int batadv_sysfs_add_hardif(struct kobject **hardif_obj , struct net_device *dev ) { struct kobject *hardif_kobject ; struct batadv_attribute **bat_attr ; int err ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp ; int tmp___0 ; struct net_device *_netdev___0 ; struct batadv_priv *_batpriv___0 ; void *tmp___1 ; int tmp___2 ; { hardif_kobject = & dev->dev.kobj; *hardif_obj = kobject_create_and_add("batman_adv", hardif_kobject); if ((unsigned long )*hardif_obj == (unsigned long )((struct kobject *)0)) { _netdev = dev; tmp = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp; tmp___0 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___0 & 63) != 0) { batadv_debug_log(_batpriv, "Can\'t add sysfs directory: %s/%s\n", (char *)(& dev->name), (char *)"batman_adv"); } else { } printk("\vbatman_adv: %s: Can\'t add sysfs directory: %s/%s\n", (char *)(& _netdev->name), (char *)(& dev->name), (char *)"batman_adv"); goto out; } else { } bat_attr = (struct batadv_attribute **)(& batadv_batman_attrs); goto ldv_50309; ldv_50308: err = sysfs_create_file(*hardif_obj, (struct attribute const *)(& (*bat_attr)->attr)); if (err != 0) { _netdev___0 = dev; tmp___1 = netdev_priv((struct net_device const *)_netdev___0); _batpriv___0 = (struct batadv_priv *)tmp___1; tmp___2 = atomic_read((atomic_t const *)(& _batpriv___0->log_level)); if ((tmp___2 & 63) != 0) { batadv_debug_log(_batpriv___0, "Can\'t add sysfs file: %s/%s/%s\n", (char *)(& dev->name), (char *)"batman_adv", (*bat_attr)->attr.name); } else { } printk("\vbatman_adv: %s: Can\'t add sysfs file: %s/%s/%s\n", (char *)(& _netdev___0->name), (char *)(& dev->name), (char *)"batman_adv", (*bat_attr)->attr.name); goto rem_attr; } else { } bat_attr = bat_attr + 1; ldv_50309: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50308; } else { } return (0); rem_attr: bat_attr = (struct batadv_attribute **)(& batadv_batman_attrs); goto ldv_50312; ldv_50311: sysfs_remove_file(*hardif_obj, (struct attribute const *)(& (*bat_attr)->attr)); bat_attr = bat_attr + 1; ldv_50312: ; if ((unsigned long )*bat_attr != (unsigned long )((struct batadv_attribute *)0)) { goto ldv_50311; } else { } out: ; return (-12); } } void batadv_sysfs_del_hardif(struct kobject **hardif_obj ) { { kobject_put(*hardif_obj); *hardif_obj = (struct kobject *)0; return; } } int batadv_throw_uevent(struct batadv_priv *bat_priv , enum batadv_uev_type type , enum batadv_uev_action action , char const *data ) { int ret ; struct kobject *bat_kobj ; char *uevent_env[4U] ; size_t tmp ; size_t tmp___0 ; void *tmp___1 ; size_t tmp___2 ; size_t tmp___3 ; void *tmp___4 ; size_t tmp___5 ; size_t tmp___6 ; void *tmp___7 ; int tmp___8 ; { ret = -12; uevent_env[0] = (char *)0; uevent_env[1] = (char *)0; uevent_env[2] = (char *)0; uevent_env[3] = (char *)0; bat_kobj = & (bat_priv->soft_iface)->dev.kobj; tmp = strlen("BATTYPE="); tmp___0 = strlen((char const *)batadv_uev_type_str[(unsigned int )type]); tmp___1 = kmalloc((tmp + tmp___0) + 1UL, 32U); uevent_env[0] = (char *)tmp___1; if ((unsigned long )uevent_env[0] == (unsigned long )((char *)0)) { goto out; } else { } sprintf(uevent_env[0], "%s%s", (char *)"BATTYPE=", batadv_uev_type_str[(unsigned int )type]); tmp___2 = strlen("BATACTION="); tmp___3 = strlen((char const *)batadv_uev_action_str[(unsigned int )action]); tmp___4 = kmalloc((tmp___2 + tmp___3) + 1UL, 32U); uevent_env[1] = (char *)tmp___4; if ((unsigned long )uevent_env[1] == (unsigned long )((char *)0)) { goto out; } else { } sprintf(uevent_env[1], "%s%s", (char *)"BATACTION=", batadv_uev_action_str[(unsigned int )action]); if ((unsigned int )action != 1U) { tmp___5 = strlen("BATDATA="); tmp___6 = strlen(data); tmp___7 = kmalloc((tmp___5 + tmp___6) + 1UL, 32U); uevent_env[2] = (char *)tmp___7; if ((unsigned long )uevent_env[2] == (unsigned long )((char *)0)) { goto out; } else { } sprintf(uevent_env[2], "%s%s", (char *)"BATDATA=", data); } else { } ret = kobject_uevent_env(bat_kobj, 2, (char **)(& uevent_env)); out: kfree((void const *)uevent_env[0]); kfree((void const *)uevent_env[1]); kfree((void const *)uevent_env[2]); if (ret != 0) { tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if (tmp___8 & 1) { batadv_debug_log(bat_priv, "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", batadv_uev_type_str[(unsigned int )type], batadv_uev_action_str[(unsigned int )action], (unsigned int )action != 1U ? data : "NULL", ret); } else { } } else { } return (ret); } } void ldv_initialize_batadv_attribute_5(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_network_coding_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_network_coding_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_9(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_gw_sel_class_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_gw_sel_class_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_3(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_vlan_ap_isolation_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_vlan_ap_isolation_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_14(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_fragmentation_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_fragmentation_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_7(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_multicast_mode_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_multicast_mode_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_11(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_orig_interval_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_orig_interval_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_8(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_gw_bandwidth_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_gw_bandwidth_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_12(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_gw_mode_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_gw_mode_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_4(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_isolation_mark_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_isolation_mark_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_10(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_hop_penalty_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_hop_penalty_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_2(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_mesh_iface_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_mesh_iface_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_17(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_bonding_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_bonding_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_16(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_bridge_loop_avoidance_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_bridge_loop_avoidance_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_18(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_aggregated_ogms_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_aggregated_ogms_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_6(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_log_level_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_log_level_group1 = (struct attribute *)tmp___0; return; } } void ldv_initialize_batadv_attribute_15(void) { void *tmp ; void *tmp___0 ; { tmp = ldv_zalloc(296UL); batadv_attr_distributed_arp_table_group0 = (struct kobject *)tmp; tmp___0 = ldv_zalloc(32UL); batadv_attr_distributed_arp_table_group1 = (struct attribute *)tmp___0; return; } } void ldv_main_exported_11(void) { char *ldvarg90 ; void *tmp ; size_t ldvarg89 ; size_t tmp___0 ; char *ldvarg88 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg90 = (char *)tmp; tmp___0 = __VERIFIER_nondet_size_t(); ldvarg89 = tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg88 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_11 == 1) { batadv_store_orig_interval(batadv_attr_orig_interval_group0, batadv_attr_orig_interval_group1, ldvarg90, ldvarg89); ldv_state_variable_11 = 1; } else { } goto ldv_50382; case 1: ; if (ldv_state_variable_11 == 1) { batadv_show_orig_interval(batadv_attr_orig_interval_group0, batadv_attr_orig_interval_group1, ldvarg88); ldv_state_variable_11 = 1; } else { } goto ldv_50382; default: ldv_stop(); } ldv_50382: ; return; } } void ldv_main_exported_7(void) { size_t ldvarg19 ; size_t tmp ; char *ldvarg20 ; void *tmp___0 ; char *ldvarg18 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg19 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg20 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg18 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_7 == 1) { batadv_store_multicast_mode(batadv_attr_multicast_mode_group0, batadv_attr_multicast_mode_group1, ldvarg20, ldvarg19); ldv_state_variable_7 = 1; } else { } goto ldv_50392; case 1: ; if (ldv_state_variable_7 == 1) { batadv_show_multicast_mode(batadv_attr_multicast_mode_group0, batadv_attr_multicast_mode_group1, ldvarg18); ldv_state_variable_7 = 1; } else { } goto ldv_50392; default: ldv_stop(); } ldv_50392: ; return; } } void ldv_main_exported_17(void) { char *ldvarg28 ; void *tmp ; char *ldvarg26 ; void *tmp___0 ; size_t ldvarg27 ; size_t tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg28 = (char *)tmp; tmp___0 = ldv_zalloc(1UL); ldvarg26 = (char *)tmp___0; tmp___1 = __VERIFIER_nondet_size_t(); ldvarg27 = tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_17 == 1) { batadv_store_bonding(batadv_attr_bonding_group0, batadv_attr_bonding_group1, ldvarg28, ldvarg27); ldv_state_variable_17 = 1; } else { } goto ldv_50402; case 1: ; if (ldv_state_variable_17 == 1) { batadv_show_bonding(batadv_attr_bonding_group0, batadv_attr_bonding_group1, ldvarg26); ldv_state_variable_17 = 1; } else { } goto ldv_50402; default: ldv_stop(); } ldv_50402: ; return; } } void ldv_main_exported_2(void) { size_t ldvarg30 ; size_t tmp ; char *ldvarg29 ; void *tmp___0 ; char *ldvarg31 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg30 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg29 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg31 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_2 == 1) { batadv_store_mesh_iface(batadv_attr_mesh_iface_group0, batadv_attr_mesh_iface_group1, ldvarg31, ldvarg30); ldv_state_variable_2 = 1; } else { } goto ldv_50412; case 1: ; if (ldv_state_variable_2 == 1) { batadv_show_mesh_iface(batadv_attr_mesh_iface_group0, batadv_attr_mesh_iface_group1, ldvarg29); ldv_state_variable_2 = 1; } else { } goto ldv_50412; default: ldv_stop(); } ldv_50412: ; return; } } void ldv_main_exported_1(void) { char *ldvarg33 ; void *tmp ; struct attribute *ldvarg34 ; void *tmp___0 ; struct kobject *ldvarg32 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg33 = (char *)tmp; tmp___0 = ldv_zalloc(32UL); ldvarg34 = (struct attribute *)tmp___0; tmp___1 = ldv_zalloc(296UL); ldvarg32 = (struct kobject *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_1 == 1) { batadv_show_iface_status(ldvarg32, ldvarg34, ldvarg33); ldv_state_variable_1 = 1; } else { } goto ldv_50422; default: ldv_stop(); } ldv_50422: ; return; } } void ldv_main_exported_18(void) { size_t ldvarg36 ; size_t tmp ; char *ldvarg35 ; void *tmp___0 ; char *ldvarg37 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg36 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg35 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg37 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_18 == 1) { batadv_store_aggregated_ogms(batadv_attr_aggregated_ogms_group0, batadv_attr_aggregated_ogms_group1, ldvarg37, ldvarg36); ldv_state_variable_18 = 1; } else { } goto ldv_50431; case 1: ; if (ldv_state_variable_18 == 1) { batadv_show_aggregated_ogms(batadv_attr_aggregated_ogms_group0, batadv_attr_aggregated_ogms_group1, ldvarg35); ldv_state_variable_18 = 1; } else { } goto ldv_50431; default: ldv_stop(); } ldv_50431: ; return; } } void ldv_main_exported_16(void) { size_t ldvarg44 ; size_t tmp ; char *ldvarg43 ; void *tmp___0 ; char *ldvarg45 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg44 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg43 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg45 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_16 == 1) { batadv_store_bridge_loop_avoidance(batadv_attr_bridge_loop_avoidance_group0, batadv_attr_bridge_loop_avoidance_group1, ldvarg45, ldvarg44); ldv_state_variable_16 = 1; } else { } goto ldv_50441; case 1: ; if (ldv_state_variable_16 == 1) { batadv_show_bridge_loop_avoidance(batadv_attr_bridge_loop_avoidance_group0, batadv_attr_bridge_loop_avoidance_group1, ldvarg43); ldv_state_variable_16 = 1; } else { } goto ldv_50441; default: ldv_stop(); } ldv_50441: ; return; } } void ldv_main_exported_13(void) { char *ldvarg94 ; void *tmp ; struct attribute *ldvarg95 ; void *tmp___0 ; struct kobject *ldvarg93 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg94 = (char *)tmp; tmp___0 = ldv_zalloc(32UL); ldvarg95 = (struct attribute *)tmp___0; tmp___1 = ldv_zalloc(296UL); ldvarg93 = (struct kobject *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_13 == 1) { batadv_show_bat_algo(ldvarg93, ldvarg95, ldvarg94); ldv_state_variable_13 = 1; } else { } goto ldv_50451; default: ldv_stop(); } ldv_50451: ; return; } } void ldv_main_exported_6(void) { char *ldvarg112 ; void *tmp ; char *ldvarg110 ; void *tmp___0 ; size_t ldvarg111 ; size_t tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg112 = (char *)tmp; tmp___0 = ldv_zalloc(1UL); ldvarg110 = (char *)tmp___0; tmp___1 = __VERIFIER_nondet_size_t(); ldvarg111 = tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_6 == 1) { batadv_store_log_level(batadv_attr_log_level_group0, batadv_attr_log_level_group1, ldvarg112, ldvarg111); ldv_state_variable_6 = 1; } else { } goto ldv_50460; case 1: ; if (ldv_state_variable_6 == 1) { batadv_show_log_level(batadv_attr_log_level_group0, batadv_attr_log_level_group1, ldvarg110); ldv_state_variable_6 = 1; } else { } goto ldv_50460; default: ldv_stop(); } ldv_50460: ; return; } } void ldv_main_exported_3(void) { char *ldvarg119 ; void *tmp ; size_t ldvarg120 ; size_t tmp___0 ; char *ldvarg121 ; void *tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg119 = (char *)tmp; tmp___0 = __VERIFIER_nondet_size_t(); ldvarg120 = tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg121 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_3 == 1) { batadv_store_vlan_ap_isolation(batadv_attr_vlan_ap_isolation_group0, batadv_attr_vlan_ap_isolation_group1, ldvarg121, ldvarg120); ldv_state_variable_3 = 1; } else { } goto ldv_50470; case 1: ; if (ldv_state_variable_3 == 1) { batadv_show_vlan_ap_isolation(batadv_attr_vlan_ap_isolation_group0, batadv_attr_vlan_ap_isolation_group1, ldvarg119); ldv_state_variable_3 = 1; } else { } goto ldv_50470; default: ldv_stop(); } ldv_50470: ; return; } } void ldv_main_exported_9(void) { char *ldvarg122 ; void *tmp ; char *ldvarg124 ; void *tmp___0 ; size_t ldvarg123 ; size_t tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg122 = (char *)tmp; tmp___0 = ldv_zalloc(1UL); ldvarg124 = (char *)tmp___0; tmp___1 = __VERIFIER_nondet_size_t(); ldvarg123 = tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_9 == 1) { batadv_store_gw_sel_class(batadv_attr_gw_sel_class_group0, batadv_attr_gw_sel_class_group1, ldvarg124, ldvarg123); ldv_state_variable_9 = 1; } else { } goto ldv_50480; case 1: ; if (ldv_state_variable_9 == 1) { batadv_show_gw_sel_class(batadv_attr_gw_sel_class_group0, batadv_attr_gw_sel_class_group1, ldvarg122); ldv_state_variable_9 = 1; } else { } goto ldv_50480; default: ldv_stop(); } ldv_50480: ; return; } } void ldv_main_exported_12(void) { size_t ldvarg126 ; size_t tmp ; char *ldvarg125 ; void *tmp___0 ; char *ldvarg127 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg126 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg125 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg127 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_12 == 1) { batadv_store_gw_mode(batadv_attr_gw_mode_group0, batadv_attr_gw_mode_group1, ldvarg127, ldvarg126); ldv_state_variable_12 = 1; } else { } goto ldv_50490; case 1: ; if (ldv_state_variable_12 == 1) { batadv_show_gw_mode(batadv_attr_gw_mode_group0, batadv_attr_gw_mode_group1, ldvarg125); ldv_state_variable_12 = 1; } else { } goto ldv_50490; default: ldv_stop(); } ldv_50490: ; return; } } void ldv_main_exported_14(void) { size_t ldvarg69 ; size_t tmp ; char *ldvarg68 ; void *tmp___0 ; char *ldvarg70 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg69 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg68 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg70 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_14 == 1) { batadv_store_fragmentation(batadv_attr_fragmentation_group0, batadv_attr_fragmentation_group1, ldvarg70, ldvarg69); ldv_state_variable_14 = 1; } else { } goto ldv_50500; case 1: ; if (ldv_state_variable_14 == 1) { batadv_show_fragmentation(batadv_attr_fragmentation_group0, batadv_attr_fragmentation_group1, ldvarg68); ldv_state_variable_14 = 1; } else { } goto ldv_50500; default: ldv_stop(); } ldv_50500: ; return; } } void ldv_main_exported_15(void) { char *ldvarg128 ; void *tmp ; char *ldvarg130 ; void *tmp___0 ; size_t ldvarg129 ; size_t tmp___1 ; int tmp___2 ; { tmp = ldv_zalloc(1UL); ldvarg128 = (char *)tmp; tmp___0 = ldv_zalloc(1UL); ldvarg130 = (char *)tmp___0; tmp___1 = __VERIFIER_nondet_size_t(); ldvarg129 = tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_15 == 1) { batadv_store_distributed_arp_table(batadv_attr_distributed_arp_table_group0, batadv_attr_distributed_arp_table_group1, ldvarg130, ldvarg129); ldv_state_variable_15 = 1; } else { } goto ldv_50510; case 1: ; if (ldv_state_variable_15 == 1) { batadv_show_distributed_arp_table(batadv_attr_distributed_arp_table_group0, batadv_attr_distributed_arp_table_group1, ldvarg128); ldv_state_variable_15 = 1; } else { } goto ldv_50510; default: ldv_stop(); } ldv_50510: ; return; } } void ldv_main_exported_8(void) { size_t ldvarg132 ; size_t tmp ; char *ldvarg133 ; void *tmp___0 ; char *ldvarg131 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg132 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg133 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg131 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_8 == 1) { batadv_store_gw_bwidth(batadv_attr_gw_bandwidth_group0, batadv_attr_gw_bandwidth_group1, ldvarg133, ldvarg132); ldv_state_variable_8 = 1; } else { } goto ldv_50520; case 1: ; if (ldv_state_variable_8 == 1) { batadv_show_gw_bwidth(batadv_attr_gw_bandwidth_group0, batadv_attr_gw_bandwidth_group1, ldvarg131); ldv_state_variable_8 = 1; } else { } goto ldv_50520; default: ldv_stop(); } ldv_50520: ; return; } } void ldv_main_exported_4(void) { size_t ldvarg135 ; size_t tmp ; char *ldvarg134 ; void *tmp___0 ; char *ldvarg136 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg135 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg134 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg136 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_4 == 1) { batadv_store_isolation_mark(batadv_attr_isolation_mark_group0, batadv_attr_isolation_mark_group1, ldvarg136, ldvarg135); ldv_state_variable_4 = 1; } else { } goto ldv_50530; case 1: ; if (ldv_state_variable_4 == 1) { batadv_show_isolation_mark(batadv_attr_isolation_mark_group0, batadv_attr_isolation_mark_group1, ldvarg134); ldv_state_variable_4 = 1; } else { } goto ldv_50530; default: ldv_stop(); } ldv_50530: ; return; } } void ldv_main_exported_10(void) { size_t ldvarg75 ; size_t tmp ; char *ldvarg74 ; void *tmp___0 ; char *ldvarg76 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg75 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg74 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg76 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_10 == 1) { batadv_store_hop_penalty(batadv_attr_hop_penalty_group0, batadv_attr_hop_penalty_group1, ldvarg76, ldvarg75); ldv_state_variable_10 = 1; } else { } goto ldv_50540; case 1: ; if (ldv_state_variable_10 == 1) { batadv_show_hop_penalty(batadv_attr_hop_penalty_group0, batadv_attr_hop_penalty_group1, ldvarg74); ldv_state_variable_10 = 1; } else { } goto ldv_50540; default: ldv_stop(); } ldv_50540: ; return; } } void ldv_main_exported_5(void) { size_t ldvarg144 ; size_t tmp ; char *ldvarg143 ; void *tmp___0 ; char *ldvarg145 ; void *tmp___1 ; int tmp___2 ; { tmp = __VERIFIER_nondet_size_t(); ldvarg144 = tmp; tmp___0 = ldv_zalloc(1UL); ldvarg143 = (char *)tmp___0; tmp___1 = ldv_zalloc(1UL); ldvarg145 = (char *)tmp___1; tmp___2 = __VERIFIER_nondet_int(); switch (tmp___2) { case 0: ; if (ldv_state_variable_5 == 1) { batadv_store_network_coding(batadv_attr_network_coding_group0, batadv_attr_network_coding_group1, ldvarg145, ldvarg144); ldv_state_variable_5 = 1; } else { } goto ldv_50550; case 1: ; if (ldv_state_variable_5 == 1) { batadv_show_network_coding(batadv_attr_network_coding_group0, batadv_attr_network_coding_group1, ldvarg143); ldv_state_variable_5 = 1; } else { } goto ldv_50550; default: ldv_stop(); } ldv_50550: ; return; } } void *ldv_kmem_cache_alloc_778(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_784(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_786(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_788(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_789(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_790(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_791(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_792(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_793(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_794(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_795(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } __inline static void atomic_add(int i , atomic_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; addl %1,%0": "+m" (v->counter): "ir" (i)); return; } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_822(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_839(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_830(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_838(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_832(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_828(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_836(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_837(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_833(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_834(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_835(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; extern struct net_device *dev_get_by_index(struct net * , int ) ; int batadv_tt_global_hash_count(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) ; __inline static uint32_t batadv_hash_bytes___2(uint32_t hash , void const *data , uint32_t size ) { unsigned char const *key ; int i ; { key = (unsigned char const *)data; i = 0; goto ldv_49594; ldv_49593: hash = (uint32_t )*(key + (unsigned long )i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1; ldv_49594: ; if ((uint32_t )i < size) { goto ldv_49593; } else { } return (hash); } } __inline static int batadv_hash_add___3(struct batadv_hashtable *hash , int (*compare)(struct hlist_node const * , void const * ) , uint32_t (*choose)(void const * , uint32_t ) , void const *data , struct hlist_node *data_node ) { uint32_t index ; int ret ; struct hlist_head *head ; struct hlist_node *node ; spinlock_t *list_lock ; int tmp ; { ret = -1; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { goto out; } else { } index = (*choose)(data, hash->size); head = hash->table + (unsigned long )index; list_lock = hash->list_locks + (unsigned long )index; spin_lock_bh(list_lock); node = head->first; goto ldv_49612; ldv_49611: tmp = (*compare)((struct hlist_node const *)node, data); if (tmp == 0) { goto ldv_49609; } else { } ret = 1; goto unlock; ldv_49609: node = node->next; ldv_49612: ; if ((unsigned long )node != (unsigned long )((struct hlist_node *)0)) { goto ldv_49611; } else { } hlist_add_head_rcu(data_node, head); ret = 0; unlock: spin_unlock_bh(list_lock); out: ; return (ret); } } __inline static void *batadv_hash_remove___0(struct batadv_hashtable *hash , int (*compare)(struct hlist_node const * , void const * ) , uint32_t (*choose)(void const * , uint32_t ) , void *data ) { uint32_t index ; struct hlist_node *node ; struct hlist_head *head ; void *data_save ; int tmp ; { data_save = (void *)0; index = (*choose)((void const *)data, hash->size); head = hash->table + (unsigned long )index; spin_lock_bh(hash->list_locks + (unsigned long )index); node = head->first; goto ldv_49627; ldv_49626: tmp = (*compare)((struct hlist_node const *)node, (void const *)data); if (tmp == 0) { goto ldv_49624; } else { } data_save = (void *)node; hlist_del_rcu(node); goto ldv_49625; ldv_49624: node = node->next; ldv_49627: ; if ((unsigned long )node != (unsigned long )((struct hlist_node *)0)) { goto ldv_49626; } else { } ldv_49625: spin_unlock_bh(hash->list_locks + (unsigned long )index); return (data_save); } } __inline static uint32_t batadv_choose_orig___8(void const *data , uint32_t size ) { unsigned char const *key ; uint32_t hash ; size_t i ; { key = (unsigned char const *)data; hash = 0U; i = 0UL; goto ldv_49701; ldv_49700: hash = (uint32_t )*(key + i) + hash; hash = (hash << 10) + hash; hash = (hash >> 6) ^ hash; i = i + 1UL; ldv_49701: ; if (i <= 5UL) { goto ldv_49700; } else { } hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } __inline static struct batadv_orig_node *batadv_orig_hash_find___6(struct batadv_priv *bat_priv , void const *data ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct batadv_orig_node *orig_node ; struct batadv_orig_node *orig_node_tmp ; int index ; uint32_t tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___1 ; int tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___5 ; { hash = bat_priv->orig_hash; orig_node_tmp = (struct batadv_orig_node *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_orig_node *)0); } else { } tmp = batadv_choose_orig___8(data, hash->size); index = (int )tmp; head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_orig_node *)__mptr + 0xfffffffffffffe88UL; } else { tmp___1 = (struct batadv_orig_node *)0; } orig_node = tmp___1; goto ldv_49735; ldv_49734: tmp___2 = batadv_compare_eth((void const *)orig_node, data); if (tmp___2 == 0) { goto ldv_49732; } else { } tmp___3 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___3 == 0) { goto ldv_49732; } else { } orig_node_tmp = orig_node; goto ldv_49733; ldv_49732: _________p1___0 = *((struct hlist_node * volatile *)(& orig_node->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_orig_node *)__mptr___0 + 0xfffffffffffffe88UL; } else { tmp___5 = (struct batadv_orig_node *)0; } orig_node = tmp___5; ldv_49735: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49734; } else { } ldv_49733: rcu_read_unlock(); return (orig_node_tmp); } } void batadv_mcast_mla_update(struct batadv_priv *bat_priv ) ; static struct lock_class_key batadv_tt_local_hash_lock_class_key ; static struct lock_class_key batadv_tt_global_hash_lock_class_key ; static void batadv_send_roam_adv(struct batadv_priv *bat_priv , uint8_t *client , unsigned short vid , struct batadv_orig_node *orig_node ) ; static void batadv_tt_purge(struct work_struct *work ) ; static void batadv_tt_global_del_orig_list(struct batadv_tt_global_entry *tt_global_entry ) ; static void batadv_tt_global_del(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , unsigned char const *addr , unsigned short vid , char const *message , bool roaming ) ; static int batadv_compare_tt(struct hlist_node const *node , void const *data2 ) { void const *data1 ; struct hlist_node const *__mptr ; int tmp ; { __mptr = node; data1 = (void const *)((struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL); tmp = batadv_compare_eth(data1, data2); return (tmp); } } __inline static uint32_t batadv_choose_tt(void const *data , uint32_t size ) { struct batadv_tt_common_entry *tt ; uint32_t hash ; { hash = 0U; tt = (struct batadv_tt_common_entry *)data; hash = batadv_hash_bytes___2(hash, (void const *)(& tt->addr), 6U); hash = batadv_hash_bytes___2(hash, (void const *)(& tt->vid), 2U); hash = (hash << 3) + hash; hash = (hash >> 11) ^ hash; hash = (hash << 15) + hash; return (hash % size); } } static struct batadv_tt_common_entry *batadv_tt_hash_find(struct batadv_hashtable *hash , uint8_t const *addr , unsigned short vid ) { struct hlist_head *head ; struct batadv_tt_common_entry to_search ; struct batadv_tt_common_entry *tt ; struct batadv_tt_common_entry *tt_tmp ; uint32_t index ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp___0 ; int tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_common_entry *tmp___4 ; { tt_tmp = (struct batadv_tt_common_entry *)0; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return ((struct batadv_tt_common_entry *)0); } else { } ether_addr_copy((u8 *)(& to_search.addr), addr); to_search.vid = vid; index = batadv_choose_tt((void const *)(& to_search), hash->size); head = hash->table + (unsigned long )index; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp___0 = (struct batadv_tt_common_entry *)0; } tt = tmp___0; goto ldv_49895; ldv_49894: tmp___1 = batadv_compare_eth((void const *)tt, (void const *)addr); if (tmp___1 == 0) { goto ldv_49892; } else { } if ((int )tt->vid != (int )vid) { goto ldv_49892; } else { } tmp___2 = atomic_add_unless(& tt->refcount, 1, 0); if (tmp___2 == 0) { goto ldv_49892; } else { } tt_tmp = tt; goto ldv_49893; ldv_49892: _________p1___0 = *((struct hlist_node * volatile *)(& tt->hash_entry.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_tt_common_entry *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___4 = (struct batadv_tt_common_entry *)0; } tt = tmp___4; ldv_49895: ; if ((unsigned long )tt != (unsigned long )((struct batadv_tt_common_entry *)0)) { goto ldv_49894; } else { } ldv_49893: rcu_read_unlock(); return (tt_tmp); } } static struct batadv_tt_local_entry *batadv_tt_local_hash_find(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) { struct batadv_tt_common_entry *tt_common_entry ; struct batadv_tt_local_entry *tt_local_entry ; struct batadv_tt_common_entry const *__mptr ; { tt_local_entry = (struct batadv_tt_local_entry *)0; tt_common_entry = batadv_tt_hash_find(bat_priv->tt.local_hash, addr, (int )vid); if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { __mptr = (struct batadv_tt_common_entry const *)tt_common_entry; tt_local_entry = (struct batadv_tt_local_entry *)__mptr; } else { } return (tt_local_entry); } } static struct batadv_tt_global_entry *batadv_tt_global_hash_find(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) { struct batadv_tt_common_entry *tt_common_entry ; struct batadv_tt_global_entry *tt_global_entry ; struct batadv_tt_common_entry const *__mptr ; { tt_global_entry = (struct batadv_tt_global_entry *)0; tt_common_entry = batadv_tt_hash_find(bat_priv->tt.global_hash, addr, (int )vid); if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { __mptr = (struct batadv_tt_common_entry const *)tt_common_entry; tt_global_entry = (struct batadv_tt_global_entry *)__mptr; } else { } return (tt_global_entry); } } static void batadv_tt_local_entry_free_ref(struct batadv_tt_local_entry *tt_local_entry ) { int tmp ; { tmp = atomic_dec_and_test(& tt_local_entry->common.refcount); if (tmp != 0) { kfree_call_rcu(& tt_local_entry->common.rcu, (void (*)(struct callback_head * ))48); } else { } return; } } static void batadv_tt_global_entry_free_ref(struct batadv_tt_global_entry *tt_global_entry ) { int tmp ; { tmp = atomic_dec_and_test(& tt_global_entry->common.refcount); if (tmp != 0) { batadv_tt_global_del_orig_list(tt_global_entry); kfree_call_rcu(& tt_global_entry->common.rcu, (void (*)(struct callback_head * ))48); } else { } return; } } int batadv_tt_global_hash_count(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) { struct batadv_tt_global_entry *tt_global_entry ; int count ; { tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr, (int )vid); if ((unsigned long )tt_global_entry == (unsigned long )((struct batadv_tt_global_entry *)0)) { return (0); } else { } count = atomic_read((atomic_t const *)(& tt_global_entry->orig_list_count)); batadv_tt_global_entry_free_ref(tt_global_entry); return (count); } } static void batadv_tt_orig_list_entry_free_rcu(struct callback_head *rcu ) { struct batadv_tt_orig_list_entry *orig_entry ; struct callback_head const *__mptr ; { __mptr = (struct callback_head const *)rcu; orig_entry = (struct batadv_tt_orig_list_entry *)__mptr + 0xffffffffffffffd8UL; batadv_orig_node_free_ref_now(orig_entry->orig_node); kfree((void const *)orig_entry); return; } } static void batadv_tt_local_size_mod(struct batadv_priv *bat_priv , unsigned short vid , int v ) { struct batadv_softif_vlan *vlan ; { vlan = batadv_softif_vlan_get(bat_priv, (int )vid); if ((unsigned long )vlan == (unsigned long )((struct batadv_softif_vlan *)0)) { return; } else { } atomic_add(v, & vlan->tt.num_entries); batadv_softif_vlan_free_ref(vlan); return; } } static void batadv_tt_local_size_inc(struct batadv_priv *bat_priv , unsigned short vid ) { { batadv_tt_local_size_mod(bat_priv, (int )vid, 1); return; } } static void batadv_tt_local_size_dec(struct batadv_priv *bat_priv , unsigned short vid ) { { batadv_tt_local_size_mod(bat_priv, (int )vid, -1); return; } } static void batadv_tt_global_size_mod(struct batadv_orig_node *orig_node , unsigned short vid , int v ) { struct batadv_orig_node_vlan *vlan ; int tmp ; { vlan = batadv_orig_node_vlan_new(orig_node, (int )vid); if ((unsigned long )vlan == (unsigned long )((struct batadv_orig_node_vlan *)0)) { return; } else { } tmp = atomic_add_return(v, & vlan->tt.num_entries); if (tmp == 0) { spin_lock_bh(& orig_node->vlan_list_lock); list_del_rcu(& vlan->list); spin_unlock_bh(& orig_node->vlan_list_lock); batadv_orig_node_vlan_free_ref(vlan); } else { } batadv_orig_node_vlan_free_ref(vlan); return; } } static void batadv_tt_global_size_inc(struct batadv_orig_node *orig_node , unsigned short vid ) { { batadv_tt_global_size_mod(orig_node, (int )vid, 1); return; } } static void batadv_tt_global_size_dec(struct batadv_orig_node *orig_node , unsigned short vid ) { { batadv_tt_global_size_mod(orig_node, (int )vid, -1); return; } } static void batadv_tt_orig_list_entry_free_ref(struct batadv_tt_orig_list_entry *orig_entry ) { int tmp ; { tmp = atomic_dec_and_test(& orig_entry->refcount); if (tmp == 0) { return; } else { } call_rcu_sched(& orig_entry->rcu, & batadv_tt_orig_list_entry_free_rcu); return; } } static void batadv_tt_local_event(struct batadv_priv *bat_priv , struct batadv_tt_local_entry *tt_local_entry , uint8_t event_flags ) { struct batadv_tt_change_node *tt_change_node ; struct batadv_tt_change_node *entry ; struct batadv_tt_change_node *safe ; struct batadv_tt_common_entry *common ; uint8_t flags ; bool event_removed ; bool del_op_requested ; bool del_op_entry ; void *tmp ; __u16 tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp___1 ; struct list_head const *__mptr___1 ; { common = & tt_local_entry->common; flags = (int )((uint8_t )common->flags) | (int )event_flags; event_removed = 0; tmp = kmalloc(32UL, 32U); tt_change_node = (struct batadv_tt_change_node *)tmp; if ((unsigned long )tt_change_node == (unsigned long )((struct batadv_tt_change_node *)0)) { return; } else { } tt_change_node->change.flags = flags; memset((void *)(& tt_change_node->change.reserved), 0, 3UL); ether_addr_copy((u8 *)(& tt_change_node->change.addr), (u8 const *)(& common->addr)); tmp___0 = __fswab16((int )common->vid); tt_change_node->change.vid = tmp___0; del_op_requested = ((int )flags & 1) != 0; spin_lock_bh(& bat_priv->tt.changes_list_lock); __mptr = (struct list_head const *)bat_priv->tt.changes_list.next; entry = (struct batadv_tt_change_node *)__mptr; __mptr___0 = (struct list_head const *)entry->list.next; safe = (struct batadv_tt_change_node *)__mptr___0; goto ldv_49989; ldv_49988: tmp___1 = batadv_compare_eth((void const *)(& entry->change.addr), (void const *)(& common->addr)); if (tmp___1 == 0) { goto ldv_49985; } else { } del_op_entry = ((int )entry->change.flags & 1) != 0; if (! del_op_requested && (int )del_op_entry) { goto del; } else { } if ((int )del_op_requested && ! del_op_entry) { goto del; } else { } if (! del_op_requested && ! del_op_entry) { entry->change.flags = flags; } else { } goto ldv_49985; del: list_del(& entry->list); kfree((void const *)entry); kfree((void const *)tt_change_node); event_removed = 1; goto unlock; ldv_49985: entry = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_change_node *)__mptr___1; ldv_49989: ; if ((unsigned long )(& entry->list) != (unsigned long )(& bat_priv->tt.changes_list)) { goto ldv_49988; } else { } list_add_tail(& tt_change_node->list, & bat_priv->tt.changes_list); unlock: spin_unlock_bh(& bat_priv->tt.changes_list_lock); if ((int )event_removed) { atomic_dec(& bat_priv->tt.local_changes); } else { atomic_inc(& bat_priv->tt.local_changes); } return; } } static int batadv_tt_len(int changes_num ) { { return ((int )((unsigned int )changes_num * 12U)); } } static uint16_t batadv_tt_entries(uint16_t tt_len ) { int tmp ; { tmp = batadv_tt_len(1); return ((uint16_t )((int )tt_len / tmp)); } } static int batadv_tt_local_table_transmit_size(struct batadv_priv *bat_priv ) { uint16_t num_vlan ; uint16_t tt_local_entries ; struct batadv_softif_vlan *vlan ; int hdr_size ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_softif_vlan *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_softif_vlan *tmp___3 ; int tmp___4 ; { num_vlan = 0U; tt_local_entries = 0U; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->softif_vlan_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_softif_vlan *)__mptr + 0xffffffffffffffe0UL; } else { tmp___0 = (struct batadv_softif_vlan *)0; } vlan = tmp___0; goto ldv_50025; ldv_50024: num_vlan = (uint16_t )((int )num_vlan + 1); tmp___1 = atomic_read((atomic_t const *)(& vlan->tt.num_entries)); tt_local_entries = (int )((uint16_t )tmp___1) + (int )tt_local_entries; _________p1___0 = *((struct hlist_node * volatile *)(& vlan->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_softif_vlan *)__mptr___0 + 0xffffffffffffffe0UL; } else { tmp___3 = (struct batadv_softif_vlan *)0; } vlan = tmp___3; ldv_50025: ; if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { goto ldv_50024; } else { } rcu_read_unlock(); hdr_size = 20; hdr_size = (int )((unsigned int )hdr_size + 4U); hdr_size = (int )((unsigned int )hdr_size + 4U); hdr_size = (int )((unsigned int )num_vlan * 8U + (unsigned int )hdr_size); tmp___4 = batadv_tt_len((int )tt_local_entries); return (tmp___4 + hdr_size); } } static int batadv_tt_local_init(struct batadv_priv *bat_priv ) { { if ((unsigned long )bat_priv->tt.local_hash != (unsigned long )((struct batadv_hashtable *)0)) { return (0); } else { } bat_priv->tt.local_hash = batadv_hash_new(1024U); if ((unsigned long )bat_priv->tt.local_hash == (unsigned long )((struct batadv_hashtable *)0)) { return (-12); } else { } batadv_hash_set_lock_class(bat_priv->tt.local_hash, & batadv_tt_local_hash_lock_class_key); return (0); } } static void batadv_tt_global_free(struct batadv_priv *bat_priv , struct batadv_tt_global_entry *tt_global , char const *message ) { int tmp ; { tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 4) != 0) { batadv_debug_log(bat_priv, "Deleting global tt entry %pM (vid: %d): %s\n", (uint8_t *)(& tt_global->common.addr), (int )((short )tt_global->common.vid) < 0 ? (int )tt_global->common.vid & 4095 : -1, message); } else { } batadv_hash_remove___0(bat_priv->tt.global_hash, & batadv_compare_tt, & batadv_choose_tt, (void *)(& tt_global->common)); batadv_tt_global_entry_free_ref(tt_global); return; } } bool batadv_tt_local_add(struct net_device *soft_iface , uint8_t const *addr , unsigned short vid , int ifindex , uint32_t mark ) { struct batadv_priv *bat_priv ; void *tmp ; struct batadv_tt_local_entry *tt_local ; struct batadv_tt_global_entry *tt_global ; struct net_device *in_dev ; struct hlist_head *head ; struct batadv_tt_orig_list_entry *orig_entry ; int hash_added ; int table_size ; int packet_size_max ; bool ret ; bool roamed_back ; uint8_t remote_flags ; uint32_t match_mark ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; int tmp___4 ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___5 ; int tmp___6 ; int tmp___7 ; void *tmp___8 ; int tmp___9 ; int tmp___10 ; bool tmp___11 ; int tmp___12 ; bool tmp___13 ; long tmp___14 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___15 ; struct hlist_node const *__mptr ; struct batadv_tt_orig_list_entry *tmp___16 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___17 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_orig_list_entry *tmp___18 ; bool tmp___19 ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; tt_global = (struct batadv_tt_global_entry *)0; in_dev = (struct net_device *)0; ret = 0; roamed_back = 0; if (ifindex != 0) { in_dev = dev_get_by_index(& init_net, ifindex); } else { } tt_local = batadv_tt_local_hash_find(bat_priv, addr, (int )vid); tmp___0 = is_multicast_ether_addr(addr); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { tt_global = batadv_tt_global_hash_find(bat_priv, addr, (int )vid); } else { } if ((unsigned long )tt_local != (unsigned long )((struct batadv_tt_local_entry *)0)) { tt_local->last_seen = jiffies; if (((int )tt_local->common.flags & 1024) != 0) { tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 4) != 0) { batadv_debug_log(bat_priv, "Re-adding pending client %pM (vid: %d)\n", addr, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } tt_local->common.flags = (unsigned int )tt_local->common.flags & 64511U; goto add_event; } else { } if (((int )tt_local->common.flags & 2) != 0) { tmp___3 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___3 & 4) != 0) { batadv_debug_log(bat_priv, "Roaming client %pM (vid: %d) came back to its original location\n", addr, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } tt_local->common.flags = (unsigned int )tt_local->common.flags & 65533U; roamed_back = 1; } else { } goto check_roaming; } else { } table_size = batadv_tt_local_table_transmit_size(bat_priv); tmp___4 = batadv_tt_len(1); table_size = tmp___4 + table_size; packet_size_max = atomic_read((atomic_t const *)(& bat_priv->packet_size_max)); if (table_size > packet_size_max) { tmp___7 = net_ratelimit(); if (tmp___7 != 0) { _netdev = soft_iface; tmp___5 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___5; tmp___6 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___6 & 63) != 0) { batadv_debug_log(_batpriv, "Local translation table size (%i) exceeds maximum packet size (%i); Ignoring new local tt entry: %pM\n", table_size, packet_size_max, addr); } else { } printk("\016batman_adv: %s: Local translation table size (%i) exceeds maximum packet size (%i); Ignoring new local tt entry: %pM\n", (char *)(& _netdev->name), table_size, packet_size_max, addr); } else { } goto out; } else { } tmp___8 = kmalloc(72UL, 32U); tt_local = (struct batadv_tt_local_entry *)tmp___8; if ((unsigned long )tt_local == (unsigned long )((struct batadv_tt_local_entry *)0)) { goto out; } else { } tmp___10 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___10 & 4) != 0) { tmp___9 = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); batadv_debug_log(bat_priv, "Creating new local tt entry: %pM (vid: %d, ttvn: %d)\n", addr, (int )((short )vid) < 0 ? (int )vid & 4095 : -1, (int )((unsigned char )tmp___9)); } else { } ether_addr_copy((u8 *)(& tt_local->common.addr), addr); tt_local->common.flags = 512U; tt_local->common.vid = vid; tmp___11 = batadv_is_wifi_netdev(in_dev); if ((int )tmp___11) { tt_local->common.flags = (uint16_t )((unsigned int )tt_local->common.flags | 16U); } else { } atomic_set(& tt_local->common.refcount, 2); tt_local->last_seen = jiffies; tt_local->common.added_at = tt_local->last_seen; tmp___12 = batadv_compare_eth((void const *)addr, (void const *)soft_iface->dev_addr); if (tmp___12 != 0) { tt_local->common.flags = (uint16_t )((unsigned int )tt_local->common.flags | 256U); } else { tmp___13 = is_multicast_ether_addr(addr); if ((int )tmp___13) { tt_local->common.flags = (uint16_t )((unsigned int )tt_local->common.flags | 256U); } else { } } hash_added = batadv_hash_add___3(bat_priv->tt.local_hash, & batadv_compare_tt, & batadv_choose_tt, (void const *)(& tt_local->common), & tt_local->common.hash_entry); tmp___14 = ldv__builtin_expect(hash_added != 0, 0L); if (tmp___14 != 0L) { batadv_tt_local_entry_free_ref(tt_local); goto out; } else { } add_event: batadv_tt_local_event(bat_priv, tt_local, 0); check_roaming: ; if ((unsigned long )tt_global != (unsigned long )((struct batadv_tt_global_entry *)0) && ((int )tt_global->common.flags & 2) == 0) { head = & tt_global->orig_list; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___15 = debug_lockdep_rcu_enabled(); if (tmp___15 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___16 = (struct batadv_tt_orig_list_entry *)__mptr + 0xfffffffffffffff0UL; } else { tmp___16 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___16; goto ldv_50081; ldv_50080: batadv_send_roam_adv(bat_priv, (uint8_t *)(& tt_global->common.addr), (int )tt_global->common.vid, orig_entry->orig_node); _________p1___0 = *((struct hlist_node * volatile *)(& orig_entry->list.next)); tmp___17 = debug_lockdep_rcu_enabled(); if (tmp___17 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___18 = (struct batadv_tt_orig_list_entry *)__mptr___0 + 0xfffffffffffffff0UL; } else { tmp___18 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___18; ldv_50081: ; if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { goto ldv_50080; } else { } rcu_read_unlock(); if ((int )roamed_back) { batadv_tt_global_free(bat_priv, tt_global, "Roaming canceled"); tt_global = (struct batadv_tt_global_entry *)0; } else { tt_global->common.flags = (uint16_t )((unsigned int )tt_global->common.flags | 2U); tt_global->roam_at = jiffies; } } else { } remote_flags = (uint8_t )tt_local->common.flags; tmp___19 = batadv_is_wifi_netdev(in_dev); if ((int )tmp___19) { tt_local->common.flags = (uint16_t )((unsigned int )tt_local->common.flags | 16U); } else { tt_local->common.flags = (unsigned int )tt_local->common.flags & 65519U; } match_mark = bat_priv->isolation_mark_mask & mark; if (bat_priv->isolation_mark_mask != 0U && bat_priv->isolation_mark == match_mark) { tt_local->common.flags = (uint16_t )((unsigned int )tt_local->common.flags | 32U); } else { tt_local->common.flags = (unsigned int )tt_local->common.flags & 65503U; } if ((int )remote_flags != ((int )tt_local->common.flags & 255)) { batadv_tt_local_event(bat_priv, tt_local, 0); } else { } ret = 1; out: ; if ((unsigned long )in_dev != (unsigned long )((struct net_device *)0)) { dev_put(in_dev); } else { } if ((unsigned long )tt_local != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_local_entry_free_ref(tt_local); } else { } if ((unsigned long )tt_global != (unsigned long )((struct batadv_tt_global_entry *)0)) { batadv_tt_global_entry_free_ref(tt_global); } else { } return (ret); } } static uint16_t batadv_tt_prepare_tvlv_global_data(struct batadv_orig_node *orig_node , struct batadv_tvlv_tt_data **tt_data , struct batadv_tvlv_tt_change **tt_change , int32_t *tt_len ) { uint16_t num_vlan ; uint16_t num_entries ; uint16_t change_offset ; uint16_t tvlv_len ; struct batadv_tvlv_tt_vlan_data *tt_vlan ; struct batadv_orig_node_vlan *vlan ; uint8_t *tt_change_ptr ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; int tmp___0 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; void *tmp___2 ; int tmp___3 ; __u16 tmp___4 ; struct list_head *__ptr___1 ; struct list_head const *__mptr___1 ; struct list_head *_________p1___1 ; bool __warned___1 ; int tmp___5 ; __u16 tmp___6 ; __u32 tmp___7 ; struct list_head *__ptr___2 ; struct list_head const *__mptr___2 ; struct list_head *_________p1___2 ; bool __warned___2 ; int tmp___8 ; { num_vlan = 0U; num_entries = 0U; rcu_read_lock(); __ptr = orig_node->vlan_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; vlan = (struct batadv_orig_node_vlan *)__mptr + 0xfffffffffffffff0UL; goto ldv_50111; ldv_50110: num_vlan = (uint16_t )((int )num_vlan + 1); tmp___0 = atomic_read((atomic_t const *)(& vlan->tt.num_entries)); num_entries = (int )((uint16_t )tmp___0) + (int )num_entries; __ptr___0 = vlan->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; vlan = (struct batadv_orig_node_vlan *)__mptr___0 + 0xfffffffffffffff0UL; ldv_50111: ; if ((unsigned long )(& vlan->list) != (unsigned long )(& orig_node->vlan_list)) { goto ldv_50110; } else { } change_offset = 4U; change_offset = (unsigned int )num_vlan * 8U + (unsigned int )change_offset; if (*tt_len < 0) { *tt_len = batadv_tt_len((int )num_entries); } else { } tvlv_len = (uint16_t )*tt_len; tvlv_len = (int )tvlv_len + (int )change_offset; tmp___2 = kmalloc((size_t )tvlv_len, 32U); *tt_data = (struct batadv_tvlv_tt_data *)tmp___2; if ((unsigned long )*tt_data == (unsigned long )((struct batadv_tvlv_tt_data *)0)) { *tt_len = 0; goto out; } else { } (*tt_data)->flags = 0U; tmp___3 = atomic_read((atomic_t const *)(& orig_node->last_ttvn)); (*tt_data)->ttvn = (uint8_t )tmp___3; tmp___4 = __fswab16((int )num_vlan); (*tt_data)->num_vlan = tmp___4; tt_vlan = (struct batadv_tvlv_tt_vlan_data *)*tt_data + 1U; __ptr___1 = orig_node->vlan_list.next; _________p1___1 = *((struct list_head * volatile *)(& __ptr___1)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___1) { rcu_read_lock_held(); } else { } __mptr___1 = (struct list_head const *)_________p1___1; vlan = (struct batadv_orig_node_vlan *)__mptr___1 + 0xfffffffffffffff0UL; goto ldv_50129; ldv_50128: tmp___6 = __fswab16((int )vlan->vid); tt_vlan->vid = tmp___6; tmp___7 = __fswab32(vlan->tt.crc); tt_vlan->crc = tmp___7; tt_vlan = tt_vlan + 1; __ptr___2 = vlan->list.next; _________p1___2 = *((struct list_head * volatile *)(& __ptr___2)); tmp___8 = debug_lockdep_rcu_enabled(); if (tmp___8 != 0 && ! __warned___2) { rcu_read_lock_held(); } else { } __mptr___2 = (struct list_head const *)_________p1___2; vlan = (struct batadv_orig_node_vlan *)__mptr___2 + 0xfffffffffffffff0UL; ldv_50129: ; if ((unsigned long )(& vlan->list) != (unsigned long )(& orig_node->vlan_list)) { goto ldv_50128; } else { } tt_change_ptr = (uint8_t *)*tt_data + (unsigned long )change_offset; *tt_change = (struct batadv_tvlv_tt_change *)tt_change_ptr; out: rcu_read_unlock(); return (tvlv_len); } } static uint16_t batadv_tt_prepare_tvlv_local_data(struct batadv_priv *bat_priv , struct batadv_tvlv_tt_data **tt_data , struct batadv_tvlv_tt_change **tt_change , int32_t *tt_len ) { struct batadv_tvlv_tt_vlan_data *tt_vlan ; struct batadv_softif_vlan *vlan ; uint16_t num_vlan ; uint16_t num_entries ; uint16_t tvlv_len ; uint8_t *tt_change_ptr ; int change_offset ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_softif_vlan *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_softif_vlan *tmp___3 ; void *tmp___4 ; int tmp___5 ; __u16 tmp___6 ; struct hlist_node *____ptr___1 ; struct hlist_node *_________p1___1 ; bool __warned___1 ; int tmp___7 ; struct hlist_node const *__mptr___1 ; struct batadv_softif_vlan *tmp___8 ; __u16 tmp___9 ; __u32 tmp___10 ; struct hlist_node *____ptr___2 ; struct hlist_node *_________p1___2 ; bool __warned___2 ; int tmp___11 ; struct hlist_node const *__mptr___2 ; struct batadv_softif_vlan *tmp___12 ; { num_vlan = 0U; num_entries = 0U; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->softif_vlan_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_softif_vlan *)__mptr + 0xffffffffffffffe0UL; } else { tmp___0 = (struct batadv_softif_vlan *)0; } vlan = tmp___0; goto ldv_50165; ldv_50164: num_vlan = (uint16_t )((int )num_vlan + 1); tmp___1 = atomic_read((atomic_t const *)(& vlan->tt.num_entries)); num_entries = (int )((uint16_t )tmp___1) + (int )num_entries; _________p1___0 = *((struct hlist_node * volatile *)(& vlan->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_softif_vlan *)__mptr___0 + 0xffffffffffffffe0UL; } else { tmp___3 = (struct batadv_softif_vlan *)0; } vlan = tmp___3; ldv_50165: ; if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { goto ldv_50164; } else { } change_offset = 4; change_offset = (int )((unsigned int )num_vlan * 8U + (unsigned int )change_offset); if (*tt_len < 0) { *tt_len = batadv_tt_len((int )num_entries); } else { } tvlv_len = (uint16_t )*tt_len; tvlv_len = (int )((uint16_t )change_offset) + (int )tvlv_len; tmp___4 = kmalloc((size_t )tvlv_len, 32U); *tt_data = (struct batadv_tvlv_tt_data *)tmp___4; if ((unsigned long )*tt_data == (unsigned long )((struct batadv_tvlv_tt_data *)0)) { tvlv_len = 0U; goto out; } else { } (*tt_data)->flags = 0U; tmp___5 = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); (*tt_data)->ttvn = (uint8_t )tmp___5; tmp___6 = __fswab16((int )num_vlan); (*tt_data)->num_vlan = tmp___6; tt_vlan = (struct batadv_tvlv_tt_vlan_data *)*tt_data + 1U; _________p1___1 = *((struct hlist_node * volatile *)(& bat_priv->softif_vlan_list.first)); tmp___7 = debug_lockdep_rcu_enabled(); if (tmp___7 != 0 && ! __warned___1) { rcu_read_lock_held(); } else { } ____ptr___1 = _________p1___1; if ((unsigned long )____ptr___1 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___1; tmp___8 = (struct batadv_softif_vlan *)__mptr___1 + 0xffffffffffffffe0UL; } else { tmp___8 = (struct batadv_softif_vlan *)0; } vlan = tmp___8; goto ldv_50189; ldv_50188: tmp___9 = __fswab16((int )vlan->vid); tt_vlan->vid = tmp___9; tmp___10 = __fswab32(vlan->tt.crc); tt_vlan->crc = tmp___10; tt_vlan = tt_vlan + 1; _________p1___2 = *((struct hlist_node * volatile *)(& vlan->list.next)); tmp___11 = debug_lockdep_rcu_enabled(); if (tmp___11 != 0 && ! __warned___2) { rcu_read_lock_held(); } else { } ____ptr___2 = _________p1___2; if ((unsigned long )____ptr___2 != (unsigned long )((struct hlist_node *)0)) { __mptr___2 = (struct hlist_node const *)____ptr___2; tmp___12 = (struct batadv_softif_vlan *)__mptr___2 + 0xffffffffffffffe0UL; } else { tmp___12 = (struct batadv_softif_vlan *)0; } vlan = tmp___12; ldv_50189: ; if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { goto ldv_50188; } else { } tt_change_ptr = (uint8_t *)*tt_data + (unsigned long )change_offset; *tt_change = (struct batadv_tvlv_tt_change *)tt_change_ptr; out: rcu_read_unlock(); return (tvlv_len); } } static void batadv_tt_tvlv_container_update(struct batadv_priv *bat_priv ) { struct batadv_tt_change_node *entry ; struct batadv_tt_change_node *safe ; struct batadv_tvlv_tt_data *tt_data ; struct batadv_tvlv_tt_change *tt_change ; int tt_diff_len ; int tt_change_len ; int tt_diff_entries_num ; int tt_diff_entries_count ; uint16_t tvlv_len ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; size_t __len ; void *__ret ; struct list_head const *__mptr___1 ; void *tmp ; size_t __len___0 ; void *__ret___0 ; { tt_change_len = 0; tt_diff_entries_num = 0; tt_diff_entries_count = 0; tt_diff_entries_num = atomic_read((atomic_t const *)(& bat_priv->tt.local_changes)); tt_diff_len = batadv_tt_len(tt_diff_entries_num); if ((unsigned int )tt_diff_len > (bat_priv->soft_iface)->mtu) { tt_diff_len = 0; } else { } tvlv_len = batadv_tt_prepare_tvlv_local_data(bat_priv, & tt_data, & tt_change, & tt_diff_len); if ((unsigned int )tvlv_len == 0U) { return; } else { } tt_data->flags = 1U; if (tt_diff_len == 0) { goto container_register; } else { } spin_lock_bh(& bat_priv->tt.changes_list_lock); atomic_set(& bat_priv->tt.local_changes, 0); __mptr = (struct list_head const *)bat_priv->tt.changes_list.next; entry = (struct batadv_tt_change_node *)__mptr; __mptr___0 = (struct list_head const *)entry->list.next; safe = (struct batadv_tt_change_node *)__mptr___0; goto ldv_50214; ldv_50213: ; if (tt_diff_entries_count < tt_diff_entries_num) { __len = 12UL; if (__len > 63UL) { __ret = __memcpy((void *)tt_change + (unsigned long )tt_diff_entries_count, (void const *)(& entry->change), __len); } else { __ret = __builtin_memcpy((void *)tt_change + (unsigned long )tt_diff_entries_count, (void const *)(& entry->change), __len); } tt_diff_entries_count = tt_diff_entries_count + 1; } else { } list_del(& entry->list); kfree((void const *)entry); entry = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_change_node *)__mptr___1; ldv_50214: ; if ((unsigned long )(& entry->list) != (unsigned long )(& bat_priv->tt.changes_list)) { goto ldv_50213; } else { } spin_unlock_bh(& bat_priv->tt.changes_list_lock); spin_lock_bh(& bat_priv->tt.last_changeset_lock); kfree((void const *)bat_priv->tt.last_changeset); bat_priv->tt.last_changeset_len = 0; bat_priv->tt.last_changeset = (unsigned char *)0U; tt_change_len = batadv_tt_len(tt_diff_entries_count); if (tt_diff_entries_count > 0) { tmp = kzalloc((size_t )tt_diff_len, 32U); bat_priv->tt.last_changeset = (unsigned char *)tmp; if ((unsigned long )bat_priv->tt.last_changeset != (unsigned long )((unsigned char *)0U)) { __len___0 = (size_t )tt_change_len; __ret___0 = __builtin_memcpy((void *)bat_priv->tt.last_changeset, (void const *)tt_change, __len___0); bat_priv->tt.last_changeset_len = (int16_t )tt_diff_len; } else { } } else { } spin_unlock_bh(& bat_priv->tt.last_changeset_lock); container_register: batadv_tvlv_container_register(bat_priv, 4, 1, (void *)tt_data, (int )tvlv_len); kfree((void const *)tt_data); return; } } int batadv_tt_local_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct batadv_tt_common_entry *tt_common_entry ; struct batadv_tt_local_entry *tt_local ; struct batadv_hard_iface *primary_if ; struct batadv_softif_vlan *vlan ; struct hlist_head *head ; unsigned short vid ; uint32_t i ; int last_seen_secs ; int last_seen_msecs ; unsigned long last_seen_jiffies ; bool no_purge ; uint16_t np_flag ; int tmp___0 ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___1 ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp___2 ; struct batadv_tt_common_entry const *__mptr___0 ; unsigned int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___4 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___5 ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->tt.local_hash; np_flag = 256U; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); seq_printf(seq, "Locally retrieved addresses (from %s) announced via TT (TTVN: %u):\n", (char *)(& net_dev->name), (int )((unsigned char )tmp___0)); seq_printf(seq, " %-13s %s %-8s %-9s (%-10s)\n", (char *)"Client", (char *)"VID", (char *)"Flags", (char *)"Last seen", (char *)"CRC"); i = 0U; goto ldv_50266; ldv_50265: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___2 = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp___2 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___2; goto ldv_50263; ldv_50262: __mptr___0 = (struct batadv_tt_common_entry const *)tt_common_entry; tt_local = (struct batadv_tt_local_entry *)__mptr___0; vid = tt_common_entry->vid; last_seen_jiffies = (unsigned long )jiffies - tt_local->last_seen; tmp___3 = jiffies_to_msecs(last_seen_jiffies); last_seen_msecs = (int )tmp___3; last_seen_secs = last_seen_msecs / 1000; last_seen_msecs = last_seen_msecs % 1000; no_purge = (unsigned int )((int )tt_common_entry->flags & (int )np_flag) != 0U; vlan = batadv_softif_vlan_get(bat_priv, (int )vid); if ((unsigned long )vlan == (unsigned long )((struct batadv_softif_vlan *)0)) { seq_printf(seq, "Cannot retrieve VLAN %d\n", (int )((short )vid) < 0 ? (int )vid & 4095 : -1); goto ldv_50261; } else { } seq_printf(seq, " * %pM %4i [%c%c%c%c%c%c] %3u.%03u (%#.8x)\n", (uint8_t *)(& tt_common_entry->addr), (int )((short )tt_common_entry->vid) < 0 ? (int )tt_common_entry->vid & 4095 : -1, ((int )tt_common_entry->flags & 2) != 0 ? 82 : 46, (int )no_purge ? 80 : 46, ((int )tt_common_entry->flags & 512) != 0 ? 78 : 46, ((int )tt_common_entry->flags & 1024) != 0 ? 88 : 46, ((int )tt_common_entry->flags & 16) != 0 ? 87 : 46, ((int )tt_common_entry->flags & 32) != 0 ? 73 : 46, (int )no_purge ? 0 : last_seen_secs, (int )no_purge ? 0 : last_seen_msecs, vlan->tt.crc); batadv_softif_vlan_free_ref(vlan); ldv_50261: _________p1___0 = *((struct hlist_node * volatile *)(& tt_common_entry->hash_entry.next)); tmp___4 = debug_lockdep_rcu_enabled(); if (tmp___4 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___5 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___5 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___5; ldv_50263: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { goto ldv_50262; } else { } rcu_read_unlock(); i = i + 1U; ldv_50266: ; if (hash->size > i) { goto ldv_50265; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } static void batadv_tt_local_set_pending(struct batadv_priv *bat_priv , struct batadv_tt_local_entry *tt_local_entry , uint16_t flags , char const *message ) { int tmp ; { batadv_tt_local_event(bat_priv, tt_local_entry, (int )((uint8_t )flags)); tt_local_entry->common.flags = (uint16_t )((unsigned int )tt_local_entry->common.flags | 1024U); tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 4) != 0) { batadv_debug_log(bat_priv, "Local tt entry (%pM, vid: %d) pending to be removed: %s\n", (uint8_t *)(& tt_local_entry->common.addr), (int )((short )tt_local_entry->common.vid) < 0 ? (int )tt_local_entry->common.vid & 4095 : -1, message); } else { } return; } } uint16_t batadv_tt_local_remove(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid , char const *message , bool roaming ) { struct batadv_tt_local_entry *tt_local_entry ; uint16_t flags ; uint16_t curr_flags ; { curr_flags = 0U; tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, (int )vid); if ((unsigned long )tt_local_entry == (unsigned long )((struct batadv_tt_local_entry *)0)) { goto out; } else { } curr_flags = tt_local_entry->common.flags; flags = 1U; if ((int )roaming) { flags = (uint16_t )((unsigned int )flags | 2U); tt_local_entry->common.flags = (uint16_t )((unsigned int )tt_local_entry->common.flags | 2U); } else { } if (((int )tt_local_entry->common.flags & 512) == 0) { batadv_tt_local_set_pending(bat_priv, tt_local_entry, (int )flags, message); goto out; } else { } batadv_tt_local_event(bat_priv, tt_local_entry, 1); hlist_del_rcu(& tt_local_entry->common.hash_entry); batadv_tt_local_entry_free_ref(tt_local_entry); out: ; if ((unsigned long )tt_local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_local_entry_free_ref(tt_local_entry); } else { } return (curr_flags); } } static void batadv_tt_local_purge_list(struct batadv_priv *bat_priv , struct hlist_head *head , int timeout ) { struct batadv_tt_local_entry *tt_local_entry ; struct batadv_tt_common_entry *tt_common_entry ; struct hlist_node *node_tmp ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp ; struct batadv_tt_common_entry const *__mptr___0 ; bool tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___2 ; { ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp; goto ldv_50306; ldv_50305: __mptr___0 = (struct batadv_tt_common_entry const *)tt_common_entry; tt_local_entry = (struct batadv_tt_local_entry *)__mptr___0; if (((int )tt_local_entry->common.flags & 256) != 0) { goto ldv_50304; } else { } if (((int )tt_local_entry->common.flags & 1024) != 0) { goto ldv_50304; } else { } tmp___0 = batadv_has_timed_out(tt_local_entry->last_seen, (unsigned int )timeout); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_50304; } else { } batadv_tt_local_set_pending(bat_priv, tt_local_entry, 1, "timed out"); ldv_50304: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___2 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___2; ldv_50306: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { node_tmp = tt_common_entry->hash_entry.next; goto ldv_50305; } else { } return; } } static void batadv_tt_local_purge(struct batadv_priv *bat_priv , int timeout ) { struct batadv_hashtable *hash ; struct hlist_head *head ; spinlock_t *list_lock ; uint32_t i ; { hash = bat_priv->tt.local_hash; i = 0U; goto ldv_50317; ldv_50316: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); batadv_tt_local_purge_list(bat_priv, head, timeout); spin_unlock_bh(list_lock); i = i + 1U; ldv_50317: ; if (hash->size > i) { goto ldv_50316; } else { } return; } } static void batadv_tt_local_table_free(struct batadv_priv *bat_priv ) { struct batadv_hashtable *hash ; spinlock_t *list_lock ; struct batadv_tt_common_entry *tt_common_entry ; struct batadv_tt_local_entry *tt_local ; struct hlist_node *node_tmp ; struct hlist_head *head ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp ; struct batadv_tt_common_entry const *__mptr___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___0 ; { if ((unsigned long )bat_priv->tt.local_hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } hash = bat_priv->tt.local_hash; i = 0U; goto ldv_50344; ldv_50343: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp; goto ldv_50341; ldv_50340: hlist_del_rcu(& tt_common_entry->hash_entry); __mptr___0 = (struct batadv_tt_common_entry const *)tt_common_entry; tt_local = (struct batadv_tt_local_entry *)__mptr___0; batadv_tt_local_entry_free_ref(tt_local); ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___0 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___0; ldv_50341: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { node_tmp = tt_common_entry->hash_entry.next; goto ldv_50340; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_50344: ; if (hash->size > i) { goto ldv_50343; } else { } batadv_hash_destroy(hash); bat_priv->tt.local_hash = (struct batadv_hashtable *)0; return; } } static int batadv_tt_global_init(struct batadv_priv *bat_priv ) { { if ((unsigned long )bat_priv->tt.global_hash != (unsigned long )((struct batadv_hashtable *)0)) { return (0); } else { } bat_priv->tt.global_hash = batadv_hash_new(1024U); if ((unsigned long )bat_priv->tt.global_hash == (unsigned long )((struct batadv_hashtable *)0)) { return (-12); } else { } batadv_hash_set_lock_class(bat_priv->tt.global_hash, & batadv_tt_global_hash_lock_class_key); return (0); } } static void batadv_tt_changes_list_free(struct batadv_priv *bat_priv ) { struct batadv_tt_change_node *entry ; struct batadv_tt_change_node *safe ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { spin_lock_bh(& bat_priv->tt.changes_list_lock); __mptr = (struct list_head const *)bat_priv->tt.changes_list.next; entry = (struct batadv_tt_change_node *)__mptr; __mptr___0 = (struct list_head const *)entry->list.next; safe = (struct batadv_tt_change_node *)__mptr___0; goto ldv_50361; ldv_50360: list_del(& entry->list); kfree((void const *)entry); entry = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_change_node *)__mptr___1; ldv_50361: ; if ((unsigned long )(& entry->list) != (unsigned long )(& bat_priv->tt.changes_list)) { goto ldv_50360; } else { } atomic_set(& bat_priv->tt.local_changes, 0); spin_unlock_bh(& bat_priv->tt.changes_list_lock); return; } } static struct batadv_tt_orig_list_entry *batadv_tt_global_orig_entry_find(struct batadv_tt_global_entry const *entry , struct batadv_orig_node const *orig_node ) { struct batadv_tt_orig_list_entry *tmp_orig_entry ; struct batadv_tt_orig_list_entry *orig_entry ; struct hlist_head const *head ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_orig_list_entry *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_orig_list_entry *tmp___3 ; { orig_entry = (struct batadv_tt_orig_list_entry *)0; rcu_read_lock(); head = & entry->orig_list; _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_orig_list_entry *)__mptr + 0xfffffffffffffff0UL; } else { tmp___0 = (struct batadv_tt_orig_list_entry *)0; } tmp_orig_entry = tmp___0; goto ldv_50393; ldv_50392: ; if ((unsigned long )((struct batadv_orig_node const *)tmp_orig_entry->orig_node) != (unsigned long )orig_node) { goto ldv_50390; } else { } tmp___1 = atomic_add_unless(& tmp_orig_entry->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_50390; } else { } orig_entry = tmp_orig_entry; goto ldv_50391; ldv_50390: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_orig_entry->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_tt_orig_list_entry *)__mptr___0 + 0xfffffffffffffff0UL; } else { tmp___3 = (struct batadv_tt_orig_list_entry *)0; } tmp_orig_entry = tmp___3; ldv_50393: ; if ((unsigned long )tmp_orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { goto ldv_50392; } else { } ldv_50391: rcu_read_unlock(); return (orig_entry); } } static bool batadv_tt_global_entry_has_orig(struct batadv_tt_global_entry const *entry , struct batadv_orig_node const *orig_node ) { struct batadv_tt_orig_list_entry *orig_entry ; bool found ; { found = 0; orig_entry = batadv_tt_global_orig_entry_find(entry, orig_node); if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { found = 1; batadv_tt_orig_list_entry_free_ref(orig_entry); } else { } return (found); } } static void batadv_tt_global_orig_entry_add(struct batadv_tt_global_entry *tt_global , struct batadv_orig_node *orig_node , int ttvn ) { struct batadv_tt_orig_list_entry *orig_entry ; void *tmp ; { orig_entry = batadv_tt_global_orig_entry_find((struct batadv_tt_global_entry const *)tt_global, (struct batadv_orig_node const *)orig_node); if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { orig_entry->ttvn = (uint8_t )ttvn; goto out; } else { } tmp = kzalloc(56UL, 32U); orig_entry = (struct batadv_tt_orig_list_entry *)tmp; if ((unsigned long )orig_entry == (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { goto out; } else { } INIT_HLIST_NODE(& orig_entry->list); atomic_inc(& orig_node->refcount); batadv_tt_global_size_inc(orig_node, (int )tt_global->common.vid); orig_entry->orig_node = orig_node; orig_entry->ttvn = (uint8_t )ttvn; atomic_set(& orig_entry->refcount, 2); spin_lock_bh(& tt_global->list_lock); hlist_add_head_rcu(& orig_entry->list, & tt_global->orig_list); spin_unlock_bh(& tt_global->list_lock); atomic_inc(& tt_global->orig_list_count); out: ; if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { batadv_tt_orig_list_entry_free_ref(orig_entry); } else { } return; } } static bool batadv_tt_global_add(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , unsigned char const *tt_addr , unsigned short vid , uint16_t flags , uint8_t ttvn ) { struct batadv_tt_global_entry *tt_global_entry ; struct batadv_tt_local_entry *tt_local_entry ; bool ret ; int hash_added ; struct batadv_tt_common_entry *common ; uint16_t local_flags ; bool tmp ; void *tmp___0 ; struct lock_class_key __key ; long tmp___1 ; bool tmp___2 ; int tmp___3 ; bool tmp___4 ; { ret = 0; tmp = batadv_bla_is_backbone_gw_orig(bat_priv, (uint8_t *)(& orig_node->orig), (int )vid); if ((int )tmp) { return (1); } else { } tt_global_entry = batadv_tt_global_hash_find(bat_priv, tt_addr, (int )vid); tt_local_entry = batadv_tt_local_hash_find(bat_priv, tt_addr, (int )vid); if ((((int )flags & 2048) != 0 && (unsigned long )tt_local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) && ((int )tt_local_entry->common.flags & 512) == 0) { goto out; } else { } if ((unsigned long )tt_global_entry == (unsigned long )((struct batadv_tt_global_entry *)0)) { tmp___0 = kzalloc(160UL, 32U); tt_global_entry = (struct batadv_tt_global_entry *)tmp___0; if ((unsigned long )tt_global_entry == (unsigned long )((struct batadv_tt_global_entry *)0)) { goto out; } else { } common = & tt_global_entry->common; ether_addr_copy((u8 *)(& common->addr), tt_addr); common->vid = vid; common->flags = flags; tt_global_entry->roam_at = 0UL; if (((int )flags & 2) != 0) { tt_global_entry->roam_at = jiffies; } else { } atomic_set(& common->refcount, 2); common->added_at = jiffies; tt_global_entry->orig_list.first = (struct hlist_node *)0; atomic_set(& tt_global_entry->orig_list_count, 0); spinlock_check(& tt_global_entry->list_lock); __raw_spin_lock_init(& tt_global_entry->list_lock.ldv_6347.rlock, "&(&tt_global_entry->list_lock)->rlock", & __key); hash_added = batadv_hash_add___3(bat_priv->tt.global_hash, & batadv_compare_tt, & batadv_choose_tt, (void const *)common, & common->hash_entry); tmp___1 = ldv__builtin_expect(hash_added != 0, 0L); if (tmp___1 != 0L) { batadv_tt_global_entry_free_ref(tt_global_entry); goto out_remove; } else { } } else { common = & tt_global_entry->common; if (((int )flags & 2048) != 0) { if (((int )common->flags & 2048) == 0) { goto out; } else { } tmp___2 = batadv_tt_global_entry_has_orig((struct batadv_tt_global_entry const *)tt_global_entry, (struct batadv_orig_node const *)orig_node); if ((int )tmp___2) { goto out_remove; } else { } batadv_tt_global_del_orig_list(tt_global_entry); goto add_orig_entry; } else { } common->flags = (unsigned int )common->flags & 63487U; tt_global_entry->common.flags = (uint16_t )((int )tt_global_entry->common.flags | (int )flags); if (((int )common->flags & 2) != 0) { batadv_tt_global_del_orig_list(tt_global_entry); common->flags = (unsigned int )common->flags & 65533U; tt_global_entry->roam_at = 0UL; } else { } } add_orig_entry: batadv_tt_global_orig_entry_add(tt_global_entry, orig_node, (int )ttvn); tmp___3 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___3 & 4) != 0) { batadv_debug_log(bat_priv, "Creating new global tt entry: %pM (vid: %d, via %pM)\n", (uint8_t *)(& common->addr), (int )((short )common->vid) < 0 ? (int )common->vid & 4095 : -1, (uint8_t *)(& orig_node->orig)); } else { } ret = 1; out_remove: tmp___4 = is_multicast_ether_addr(tt_addr); if ((int )tmp___4) { goto out; } else { } local_flags = batadv_tt_local_remove(bat_priv, tt_addr, (int )vid, "global tt received", ((int )flags & 2) != 0); tt_global_entry->common.flags = (uint16_t )((int )((short )tt_global_entry->common.flags) | ((int )((short )local_flags) & 16)); if (((int )flags & 2) == 0) { tt_global_entry->common.flags = (unsigned int )tt_global_entry->common.flags & 65533U; } else { } out: ; if ((unsigned long )tt_global_entry != (unsigned long )((struct batadv_tt_global_entry *)0)) { batadv_tt_global_entry_free_ref(tt_global_entry); } else { } if ((unsigned long )tt_local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_local_entry_free_ref(tt_local_entry); } else { } return (ret); } } static struct batadv_tt_orig_list_entry *batadv_transtable_best_orig(struct batadv_priv *bat_priv , struct batadv_tt_global_entry *tt_global_entry ) { struct batadv_neigh_node *router ; struct batadv_neigh_node *best_router ; struct batadv_algo_ops *bao ; struct hlist_head *head ; struct batadv_tt_orig_list_entry *orig_entry ; struct batadv_tt_orig_list_entry *best_entry ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_orig_list_entry *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_orig_list_entry *tmp___3 ; { best_router = (struct batadv_neigh_node *)0; bao = bat_priv->bat_algo_ops; best_entry = (struct batadv_tt_orig_list_entry *)0; head = & tt_global_entry->orig_list; _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_orig_list_entry *)__mptr + 0xfffffffffffffff0UL; } else { tmp___0 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___0; goto ldv_50457; ldv_50456: router = batadv_orig_router_get(orig_entry->orig_node, (struct batadv_hard_iface const *)0); if ((unsigned long )router == (unsigned long )((struct batadv_neigh_node *)0)) { goto ldv_50455; } else { } if ((unsigned long )best_router != (unsigned long )((struct batadv_neigh_node *)0)) { tmp___1 = (*(bao->bat_neigh_cmp))(router, (struct batadv_hard_iface *)0, best_router, (struct batadv_hard_iface *)0); if (tmp___1 <= 0) { batadv_neigh_node_free_ref(router); goto ldv_50455; } else { } } else { } if ((unsigned long )best_router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(best_router); } else { } best_entry = orig_entry; best_router = router; ldv_50455: _________p1___0 = *((struct hlist_node * volatile *)(& orig_entry->list.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_tt_orig_list_entry *)__mptr___0 + 0xfffffffffffffff0UL; } else { tmp___3 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___3; ldv_50457: ; if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { goto ldv_50456; } else { } if ((unsigned long )best_router != (unsigned long )((struct batadv_neigh_node *)0)) { batadv_neigh_node_free_ref(best_router); } else { } return (best_entry); } } static void batadv_tt_global_print_entry(struct batadv_priv *bat_priv , struct batadv_tt_global_entry *tt_global_entry , struct seq_file *seq ) { struct batadv_tt_orig_list_entry *orig_entry ; struct batadv_tt_orig_list_entry *best_entry ; struct batadv_tt_common_entry *tt_common_entry ; struct batadv_orig_node_vlan *vlan ; struct hlist_head *head ; uint8_t last_ttvn ; uint16_t flags ; int tmp ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_tt_orig_list_entry *tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_orig_list_entry *tmp___4 ; { tt_common_entry = & tt_global_entry->common; flags = tt_common_entry->flags; best_entry = batadv_transtable_best_orig(bat_priv, tt_global_entry); if ((unsigned long )best_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { vlan = batadv_orig_node_vlan_get(best_entry->orig_node, (int )tt_common_entry->vid); if ((unsigned long )vlan == (unsigned long )((struct batadv_orig_node_vlan *)0)) { seq_printf(seq, " * Cannot retrieve VLAN %d for originator %pM\n", (int )((short )tt_common_entry->vid) < 0 ? (int )tt_common_entry->vid & 4095 : -1, (uint8_t *)(& (best_entry->orig_node)->orig)); goto print_list; } else { } tmp = atomic_read((atomic_t const *)(& (best_entry->orig_node)->last_ttvn)); last_ttvn = (uint8_t )tmp; seq_printf(seq, " %c %pM %4i (%3u) via %pM (%3u) (%#.8x) [%c%c%c%c]\n", 42, (uint8_t *)(& tt_global_entry->common.addr), (int )((short )tt_global_entry->common.vid) < 0 ? (int )tt_global_entry->common.vid & 4095 : -1, (int )best_entry->ttvn, (uint8_t *)(& (best_entry->orig_node)->orig), (int )last_ttvn, vlan->tt.crc, ((int )flags & 2) != 0 ? 82 : 46, ((int )flags & 16) != 0 ? 87 : 46, ((int )flags & 32) != 0 ? 73 : 46, ((int )flags & 2048) != 0 ? 84 : 46); batadv_orig_node_vlan_free_ref(vlan); } else { } print_list: head = & tt_global_entry->orig_list; _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_tt_orig_list_entry *)__mptr + 0xfffffffffffffff0UL; } else { tmp___1 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___1; goto ldv_50494; ldv_50493: ; if ((unsigned long )best_entry == (unsigned long )orig_entry) { goto ldv_50492; } else { } vlan = batadv_orig_node_vlan_get(orig_entry->orig_node, (int )tt_common_entry->vid); if ((unsigned long )vlan == (unsigned long )((struct batadv_orig_node_vlan *)0)) { seq_printf(seq, " + Cannot retrieve VLAN %d for originator %pM\n", (int )((short )tt_common_entry->vid) < 0 ? (int )tt_common_entry->vid & 4095 : -1, (uint8_t *)(& (orig_entry->orig_node)->orig)); goto ldv_50492; } else { } tmp___2 = atomic_read((atomic_t const *)(& (orig_entry->orig_node)->last_ttvn)); last_ttvn = (uint8_t )tmp___2; seq_printf(seq, " %c %pM %4d (%3u) via %pM (%3u) (%#.8x) [%c%c%c%c]\n", 43, (uint8_t *)(& tt_global_entry->common.addr), (int )((short )tt_global_entry->common.vid) < 0 ? (int )tt_global_entry->common.vid & 4095 : -1, (int )orig_entry->ttvn, (uint8_t *)(& (orig_entry->orig_node)->orig), (int )last_ttvn, vlan->tt.crc, ((int )flags & 2) != 0 ? 82 : 46, ((int )flags & 16) != 0 ? 87 : 46, ((int )flags & 32) != 0 ? 73 : 46, ((int )flags & 2048) != 0 ? 84 : 46); batadv_orig_node_vlan_free_ref(vlan); ldv_50492: _________p1___0 = *((struct hlist_node * volatile *)(& orig_entry->list.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_tt_orig_list_entry *)__mptr___0 + 0xfffffffffffffff0UL; } else { tmp___4 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___4; ldv_50494: ; if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { goto ldv_50493; } else { } return; } } int batadv_tt_global_seq_print_text(struct seq_file *seq , void *offset ) { struct net_device *net_dev ; struct batadv_priv *bat_priv ; void *tmp ; struct batadv_hashtable *hash ; struct batadv_tt_common_entry *tt_common_entry ; struct batadv_tt_global_entry *tt_global ; struct batadv_hard_iface *primary_if ; struct hlist_head *head ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp___0 ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp___1 ; struct batadv_tt_common_entry const *__mptr___0 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___3 ; { net_dev = (struct net_device *)seq->private; tmp = netdev_priv((struct net_device const *)net_dev); bat_priv = (struct batadv_priv *)tmp; hash = bat_priv->tt.global_hash; primary_if = batadv_seq_print_text_primary_if_get(seq); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } seq_printf(seq, "Globally announced TT entries received via the mesh %s\n", (char *)(& net_dev->name)); seq_printf(seq, " %-13s %s %s %-15s %s (%-10s) %s\n", (char *)"Client", (char *)"VID", (char *)"(TTVN)", (char *)"Originator", (char *)"(Curr TTVN)", (char *)"CRC", (char *)"Flags"); i = 0U; goto ldv_50535; ldv_50534: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp___0 = debug_lockdep_rcu_enabled(); if (tmp___0 != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___1 = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp___1 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___1; goto ldv_50532; ldv_50531: __mptr___0 = (struct batadv_tt_common_entry const *)tt_common_entry; tt_global = (struct batadv_tt_global_entry *)__mptr___0; batadv_tt_global_print_entry(bat_priv, tt_global, seq); _________p1___0 = *((struct hlist_node * volatile *)(& tt_common_entry->hash_entry.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___3 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___3; ldv_50532: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { goto ldv_50531; } else { } rcu_read_unlock(); i = i + 1U; ldv_50535: ; if (hash->size > i) { goto ldv_50534; } else { } out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return (0); } } static void batadv_tt_global_del_orig_entry(struct batadv_tt_global_entry *tt_global_entry , struct batadv_tt_orig_list_entry *orig_entry ) { { batadv_tt_global_size_dec(orig_entry->orig_node, (int )tt_global_entry->common.vid); atomic_dec(& tt_global_entry->orig_list_count); hlist_del_rcu(& orig_entry->list); batadv_tt_orig_list_entry_free_ref(orig_entry); return; } } static void batadv_tt_global_del_orig_list(struct batadv_tt_global_entry *tt_global_entry ) { struct hlist_head *head ; struct hlist_node *safe ; struct batadv_tt_orig_list_entry *orig_entry ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_orig_list_entry *tmp ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_orig_list_entry *tmp___0 ; { spin_lock_bh(& tt_global_entry->list_lock); head = & tt_global_entry->orig_list; ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_orig_list_entry *)__mptr + 0xfffffffffffffff0UL; } else { tmp = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp; goto ldv_50557; ldv_50556: batadv_tt_global_del_orig_entry(tt_global_entry, orig_entry); ____ptr___0 = safe; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_tt_orig_list_entry *)__mptr___0 + 0xfffffffffffffff0UL; } else { tmp___0 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___0; ldv_50557: ; if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { safe = orig_entry->list.next; goto ldv_50556; } else { } spin_unlock_bh(& tt_global_entry->list_lock); return; } } static void batadv_tt_global_del_orig_node(struct batadv_priv *bat_priv , struct batadv_tt_global_entry *tt_global_entry , struct batadv_orig_node *orig_node , char const *message ) { struct hlist_head *head ; struct hlist_node *safe ; struct batadv_tt_orig_list_entry *orig_entry ; unsigned short vid ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_orig_list_entry *tmp ; int tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_orig_list_entry *tmp___1 ; { spin_lock_bh(& tt_global_entry->list_lock); head = & tt_global_entry->orig_list; ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_orig_list_entry *)__mptr + 0xfffffffffffffff0UL; } else { tmp = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp; goto ldv_50579; ldv_50578: ; if ((unsigned long )orig_entry->orig_node == (unsigned long )orig_node) { vid = tt_global_entry->common.vid; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 4) != 0) { batadv_debug_log(bat_priv, "Deleting %pM from global tt entry %pM (vid: %d): %s\n", (uint8_t *)(& orig_node->orig), (uint8_t *)(& tt_global_entry->common.addr), (int )((short )vid) < 0 ? (int )vid & 4095 : -1, message); } else { } batadv_tt_global_del_orig_entry(tt_global_entry, orig_entry); } else { } ____ptr___0 = safe; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_tt_orig_list_entry *)__mptr___0 + 0xfffffffffffffff0UL; } else { tmp___1 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___1; ldv_50579: ; if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { safe = orig_entry->list.next; goto ldv_50578; } else { } spin_unlock_bh(& tt_global_entry->list_lock); return; } } static void batadv_tt_global_del_roaming(struct batadv_priv *bat_priv , struct batadv_tt_global_entry *tt_global_entry , struct batadv_orig_node *orig_node , char const *message ) { bool last_entry ; struct hlist_head *head ; struct batadv_tt_orig_list_entry *orig_entry ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_orig_list_entry *tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___1 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_orig_list_entry *tmp___2 ; { last_entry = 1; rcu_read_lock(); head = & tt_global_entry->orig_list; _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_orig_list_entry *)__mptr + 0xfffffffffffffff0UL; } else { tmp___0 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___0; goto ldv_50612; ldv_50611: ; if ((unsigned long )orig_entry->orig_node != (unsigned long )orig_node) { last_entry = 0; goto ldv_50610; } else { } _________p1___0 = *((struct hlist_node * volatile *)(& orig_entry->list.next)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_tt_orig_list_entry *)__mptr___0 + 0xfffffffffffffff0UL; } else { tmp___2 = (struct batadv_tt_orig_list_entry *)0; } orig_entry = tmp___2; ldv_50612: ; if ((unsigned long )orig_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { goto ldv_50611; } else { } ldv_50610: rcu_read_unlock(); if ((int )last_entry) { tt_global_entry->common.flags = (uint16_t )((unsigned int )tt_global_entry->common.flags | 2U); tt_global_entry->roam_at = jiffies; } else { batadv_tt_global_del_orig_node(bat_priv, tt_global_entry, orig_node, message); } return; } } static void batadv_tt_global_del(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , unsigned char const *addr , unsigned short vid , char const *message , bool roaming ) { struct batadv_tt_global_entry *tt_global_entry ; struct batadv_tt_local_entry *local_entry ; int tmp ; { local_entry = (struct batadv_tt_local_entry *)0; tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr, (int )vid); if ((unsigned long )tt_global_entry == (unsigned long )((struct batadv_tt_global_entry *)0)) { goto out; } else { } if (! roaming) { batadv_tt_global_del_orig_node(bat_priv, tt_global_entry, orig_node, message); tmp = hlist_empty((struct hlist_head const *)(& tt_global_entry->orig_list)); if (tmp != 0) { batadv_tt_global_free(bat_priv, tt_global_entry, message); } else { } goto out; } else { } local_entry = batadv_tt_local_hash_find(bat_priv, (uint8_t const *)(& tt_global_entry->common.addr), (int )vid); if ((unsigned long )local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_global_del_orig_list(tt_global_entry); batadv_tt_global_free(bat_priv, tt_global_entry, message); } else { batadv_tt_global_del_roaming(bat_priv, tt_global_entry, orig_node, message); } out: ; if ((unsigned long )tt_global_entry != (unsigned long )((struct batadv_tt_global_entry *)0)) { batadv_tt_global_entry_free_ref(tt_global_entry); } else { } if ((unsigned long )local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_local_entry_free_ref(local_entry); } else { } return; } } void batadv_tt_global_del_orig(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , int32_t match_vid , char const *message ) { struct batadv_tt_global_entry *tt_global ; struct batadv_tt_common_entry *tt_common_entry ; uint32_t i ; struct batadv_hashtable *hash ; struct hlist_node *safe ; struct hlist_head *head ; spinlock_t *list_lock ; unsigned short vid ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp ; struct batadv_tt_common_entry const *__mptr___0 ; int tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___2 ; { hash = bat_priv->tt.global_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0U; goto ldv_50654; ldv_50653: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp; goto ldv_50651; ldv_50650: ; if (match_vid >= 0 && (int32_t )tt_common_entry->vid != match_vid) { goto ldv_50647; } else { } __mptr___0 = (struct batadv_tt_common_entry const *)tt_common_entry; tt_global = (struct batadv_tt_global_entry *)__mptr___0; batadv_tt_global_del_orig_node(bat_priv, tt_global, orig_node, message); tmp___1 = hlist_empty((struct hlist_head const *)(& tt_global->orig_list)); if (tmp___1 != 0) { vid = tt_global->common.vid; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 4) != 0) { batadv_debug_log(bat_priv, "Deleting global tt entry %pM (vid: %d): %s\n", (uint8_t *)(& tt_global->common.addr), (int )((short )vid) < 0 ? (int )vid & 4095 : -1, message); } else { } hlist_del_rcu(& tt_common_entry->hash_entry); batadv_tt_global_entry_free_ref(tt_global); } else { } ldv_50647: ____ptr___0 = safe; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___2 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___2; ldv_50651: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { safe = tt_common_entry->hash_entry.next; goto ldv_50650; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_50654: ; if (hash->size > i) { goto ldv_50653; } else { } orig_node->capa_initialized = (unsigned int )orig_node->capa_initialized & 251U; return; } } static bool batadv_tt_global_to_purge(struct batadv_tt_global_entry *tt_global , char **msg ) { bool purge ; unsigned long roam_timeout ; unsigned long temp_timeout ; bool tmp ; bool tmp___0 ; { purge = 0; roam_timeout = 600000UL; temp_timeout = 600000UL; if (((int )tt_global->common.flags & 2) != 0) { tmp = batadv_has_timed_out(tt_global->roam_at, (unsigned int )roam_timeout); if ((int )tmp) { purge = 1; *msg = (char *)"Roaming timeout\n"; } else { } } else { } if (((int )tt_global->common.flags & 2048) != 0) { tmp___0 = batadv_has_timed_out(tt_global->common.added_at, (unsigned int )temp_timeout); if ((int )tmp___0) { purge = 1; *msg = (char *)"Temporary client timeout\n"; } else { } } else { } return (purge); } } static void batadv_tt_global_purge(struct batadv_priv *bat_priv ) { struct batadv_hashtable *hash ; struct hlist_head *head ; struct hlist_node *node_tmp ; spinlock_t *list_lock ; uint32_t i ; char *msg ; struct batadv_tt_common_entry *tt_common ; struct batadv_tt_global_entry *tt_global ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp ; struct batadv_tt_common_entry const *__mptr___0 ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___3 ; { hash = bat_priv->tt.global_hash; msg = (char *)0; i = 0U; goto ldv_50690; ldv_50689: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp = (struct batadv_tt_common_entry *)0; } tt_common = tmp; goto ldv_50687; ldv_50686: __mptr___0 = (struct batadv_tt_common_entry const *)tt_common; tt_global = (struct batadv_tt_global_entry *)__mptr___0; tmp___0 = batadv_tt_global_to_purge(tt_global, & msg); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto ldv_50685; } else { } tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 4) != 0) { batadv_debug_log(bat_priv, "Deleting global tt entry %pM (vid: %d): %s\n", (uint8_t *)(& tt_global->common.addr), (int )((short )tt_global->common.vid) < 0 ? (int )tt_global->common.vid & 4095 : -1, msg); } else { } hlist_del_rcu(& tt_common->hash_entry); batadv_tt_global_entry_free_ref(tt_global); ldv_50685: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___3 = (struct batadv_tt_common_entry *)0; } tt_common = tmp___3; ldv_50687: ; if ((unsigned long )tt_common != (unsigned long )((struct batadv_tt_common_entry *)0)) { node_tmp = tt_common->hash_entry.next; goto ldv_50686; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_50690: ; if (hash->size > i) { goto ldv_50689; } else { } return; } } static void batadv_tt_global_table_free(struct batadv_priv *bat_priv ) { struct batadv_hashtable *hash ; spinlock_t *list_lock ; struct batadv_tt_common_entry *tt_common_entry ; struct batadv_tt_global_entry *tt_global ; struct hlist_node *node_tmp ; struct hlist_head *head ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp ; struct batadv_tt_common_entry const *__mptr___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___0 ; { if ((unsigned long )bat_priv->tt.global_hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } hash = bat_priv->tt.global_hash; i = 0U; goto ldv_50717; ldv_50716: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp; goto ldv_50714; ldv_50713: hlist_del_rcu(& tt_common_entry->hash_entry); __mptr___0 = (struct batadv_tt_common_entry const *)tt_common_entry; tt_global = (struct batadv_tt_global_entry *)__mptr___0; batadv_tt_global_entry_free_ref(tt_global); ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___0 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___0 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___0; ldv_50714: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { node_tmp = tt_common_entry->hash_entry.next; goto ldv_50713; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_50717: ; if (hash->size > i) { goto ldv_50716; } else { } batadv_hash_destroy(hash); bat_priv->tt.global_hash = (struct batadv_hashtable *)0; return; } } static bool _batadv_is_ap_isolated(struct batadv_tt_local_entry *tt_local_entry , struct batadv_tt_global_entry *tt_global_entry ) { bool ret ; { ret = 0; if (((int )tt_local_entry->common.flags & 16) != 0 && ((int )tt_global_entry->common.flags & 16) != 0) { ret = 1; } else { } if (((int )tt_local_entry->common.flags & 32) != 0 && ((int )tt_global_entry->common.flags & 32) != 0) { ret = 1; } else { } return (ret); } } struct batadv_orig_node *batadv_transtable_search(struct batadv_priv *bat_priv , uint8_t const *src , uint8_t const *addr , unsigned short vid ) { struct batadv_tt_local_entry *tt_local_entry ; struct batadv_tt_global_entry *tt_global_entry ; struct batadv_orig_node *orig_node ; struct batadv_tt_orig_list_entry *best_entry ; bool tmp ; bool tmp___0 ; int tmp___1 ; { tt_local_entry = (struct batadv_tt_local_entry *)0; tt_global_entry = (struct batadv_tt_global_entry *)0; orig_node = (struct batadv_orig_node *)0; if ((unsigned long )src != (unsigned long )((uint8_t const *)0U)) { tmp = batadv_vlan_ap_isola_get(bat_priv, (int )vid); if ((int )tmp) { tt_local_entry = batadv_tt_local_hash_find(bat_priv, src, (int )vid); if ((unsigned long )tt_local_entry == (unsigned long )((struct batadv_tt_local_entry *)0) || ((int )tt_local_entry->common.flags & 1024) != 0) { goto out; } else { } } else { } } else { } tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr, (int )vid); if ((unsigned long )tt_global_entry == (unsigned long )((struct batadv_tt_global_entry *)0)) { goto out; } else { } if ((unsigned long )tt_local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { tmp___0 = _batadv_is_ap_isolated(tt_local_entry, tt_global_entry); if ((int )tmp___0) { goto out; } else { } } else { } rcu_read_lock(); best_entry = batadv_transtable_best_orig(bat_priv, tt_global_entry); if ((unsigned long )best_entry != (unsigned long )((struct batadv_tt_orig_list_entry *)0)) { orig_node = best_entry->orig_node; } else { } if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { tmp___1 = atomic_add_unless(& orig_node->refcount, 1, 0); if (tmp___1 == 0) { orig_node = (struct batadv_orig_node *)0; } else { } } else { } rcu_read_unlock(); out: ; if ((unsigned long )tt_global_entry != (unsigned long )((struct batadv_tt_global_entry *)0)) { batadv_tt_global_entry_free_ref(tt_global_entry); } else { } if ((unsigned long )tt_local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_local_entry_free_ref(tt_local_entry); } else { } return (orig_node); } } static uint32_t batadv_tt_global_crc(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , unsigned short vid ) { struct batadv_hashtable *hash ; struct batadv_tt_common_entry *tt_common ; struct batadv_tt_global_entry *tt_global ; struct hlist_head *head ; uint32_t i ; uint32_t crc_tmp ; uint32_t crc ; uint8_t flags ; __be16 tmp_vid ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp___0 ; struct batadv_tt_common_entry const *__mptr___0 ; bool tmp___1 ; int tmp___2 ; __u16 tmp___3 ; u32 tmp___4 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___5 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___6 ; { hash = bat_priv->tt.global_hash; crc = 0U; i = 0U; goto ldv_50776; ldv_50775: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp___0 = (struct batadv_tt_common_entry *)0; } tt_common = tmp___0; goto ldv_50773; ldv_50772: __mptr___0 = (struct batadv_tt_common_entry const *)tt_common; tt_global = (struct batadv_tt_global_entry *)__mptr___0; if ((int )tt_common->vid != (int )vid) { goto ldv_50771; } else { } if (((int )tt_common->flags & 2) != 0) { goto ldv_50771; } else { } if (((int )tt_common->flags & 2048) != 0) { goto ldv_50771; } else { } tmp___1 = batadv_tt_global_entry_has_orig((struct batadv_tt_global_entry const *)tt_global, (struct batadv_orig_node const *)orig_node); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { goto ldv_50771; } else { } tmp___3 = __fswab16((int )tt_common->vid); tmp_vid = tmp___3; crc_tmp = crc32c(0U, (void const *)(& tmp_vid), 2U); flags = (unsigned int )((uint8_t )tt_common->flags) & 240U; crc_tmp = crc32c(crc_tmp, (void const *)(& flags), 1U); tmp___4 = crc32c(crc_tmp, (void const *)(& tt_common->addr), 6U); crc = tmp___4 ^ crc; ldv_50771: _________p1___0 = *((struct hlist_node * volatile *)(& tt_common->hash_entry.next)); tmp___5 = debug_lockdep_rcu_enabled(); if (tmp___5 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___6 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___6 = (struct batadv_tt_common_entry *)0; } tt_common = tmp___6; ldv_50773: ; if ((unsigned long )tt_common != (unsigned long )((struct batadv_tt_common_entry *)0)) { goto ldv_50772; } else { } rcu_read_unlock(); i = i + 1U; ldv_50776: ; if (hash->size > i) { goto ldv_50775; } else { } return (crc); } } static uint32_t batadv_tt_local_crc(struct batadv_priv *bat_priv , unsigned short vid ) { struct batadv_hashtable *hash ; struct batadv_tt_common_entry *tt_common ; struct hlist_head *head ; uint32_t i ; uint32_t crc_tmp ; uint32_t crc ; uint8_t flags ; __be16 tmp_vid ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp___0 ; __u16 tmp___1 ; u32 tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_common_entry *tmp___4 ; { hash = bat_priv->tt.local_hash; crc = 0U; i = 0U; goto ldv_50815; ldv_50814: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp___0 = (struct batadv_tt_common_entry *)0; } tt_common = tmp___0; goto ldv_50812; ldv_50811: ; if ((int )tt_common->vid != (int )vid) { goto ldv_50810; } else { } if (((int )tt_common->flags & 512) != 0) { goto ldv_50810; } else { } tmp___1 = __fswab16((int )tt_common->vid); tmp_vid = tmp___1; crc_tmp = crc32c(0U, (void const *)(& tmp_vid), 2U); flags = (unsigned int )((uint8_t )tt_common->flags) & 240U; crc_tmp = crc32c(crc_tmp, (void const *)(& flags), 1U); tmp___2 = crc32c(crc_tmp, (void const *)(& tt_common->addr), 6U); crc = tmp___2 ^ crc; ldv_50810: _________p1___0 = *((struct hlist_node * volatile *)(& tt_common->hash_entry.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_tt_common_entry *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___4 = (struct batadv_tt_common_entry *)0; } tt_common = tmp___4; ldv_50812: ; if ((unsigned long )tt_common != (unsigned long )((struct batadv_tt_common_entry *)0)) { goto ldv_50811; } else { } rcu_read_unlock(); i = i + 1U; ldv_50815: ; if (hash->size > i) { goto ldv_50814; } else { } return (crc); } } static void batadv_tt_req_list_free(struct batadv_priv *bat_priv ) { struct batadv_tt_req_node *node ; struct batadv_tt_req_node *safe ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { spin_lock_bh(& bat_priv->tt.req_list_lock); __mptr = (struct list_head const *)bat_priv->tt.req_list.next; node = (struct batadv_tt_req_node *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct list_head const *)node->list.next; safe = (struct batadv_tt_req_node *)__mptr___0 + 0xfffffffffffffff0UL; goto ldv_50829; ldv_50828: list_del(& node->list); kfree((void const *)node); node = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_req_node *)__mptr___1 + 0xfffffffffffffff0UL; ldv_50829: ; if ((unsigned long )(& node->list) != (unsigned long )(& bat_priv->tt.req_list)) { goto ldv_50828; } else { } spin_unlock_bh(& bat_priv->tt.req_list_lock); return; } } static void batadv_tt_save_orig_buffer(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , void const *tt_buff , uint16_t tt_buff_len ) { void *tmp ; size_t __len ; void *__ret ; { spin_lock_bh(& orig_node->tt_buff_lock); if ((unsigned int )tt_buff_len != 0U) { kfree((void const *)orig_node->tt_buff); orig_node->tt_buff_len = 0; tmp = kmalloc((size_t )tt_buff_len, 32U); orig_node->tt_buff = (unsigned char *)tmp; if ((unsigned long )orig_node->tt_buff != (unsigned long )((unsigned char *)0U)) { __len = (size_t )tt_buff_len; __ret = __builtin_memcpy((void *)orig_node->tt_buff, tt_buff, __len); orig_node->tt_buff_len = (int16_t )tt_buff_len; } else { } } else { } spin_unlock_bh(& orig_node->tt_buff_lock); return; } } static void batadv_tt_req_purge(struct batadv_priv *bat_priv ) { struct batadv_tt_req_node *node ; struct batadv_tt_req_node *safe ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; bool tmp ; struct list_head const *__mptr___1 ; { spin_lock_bh(& bat_priv->tt.req_list_lock); __mptr = (struct list_head const *)bat_priv->tt.req_list.next; node = (struct batadv_tt_req_node *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct list_head const *)node->list.next; safe = (struct batadv_tt_req_node *)__mptr___0 + 0xfffffffffffffff0UL; goto ldv_50852; ldv_50851: tmp = batadv_has_timed_out(node->issued_at, 3000U); if ((int )tmp) { list_del(& node->list); kfree((void const *)node); } else { } node = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_req_node *)__mptr___1 + 0xfffffffffffffff0UL; ldv_50852: ; if ((unsigned long )(& node->list) != (unsigned long )(& bat_priv->tt.req_list)) { goto ldv_50851; } else { } spin_unlock_bh(& bat_priv->tt.req_list_lock); return; } } static struct batadv_tt_req_node *batadv_new_tt_req_node(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct batadv_tt_req_node *tt_req_node_tmp ; struct batadv_tt_req_node *tt_req_node ; struct list_head const *__mptr ; int tmp ; bool tmp___0 ; int tmp___1 ; struct list_head const *__mptr___0 ; void *tmp___2 ; { tt_req_node = (struct batadv_tt_req_node *)0; spin_lock_bh(& bat_priv->tt.req_list_lock); __mptr = (struct list_head const *)bat_priv->tt.req_list.next; tt_req_node_tmp = (struct batadv_tt_req_node *)__mptr + 0xfffffffffffffff0UL; goto ldv_50866; ldv_50865: tmp = batadv_compare_eth((void const *)tt_req_node_tmp, (void const *)orig_node); if (tmp != 0) { tmp___0 = batadv_has_timed_out(tt_req_node_tmp->issued_at, 3000U); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto unlock; } else { } } else { } __mptr___0 = (struct list_head const *)tt_req_node_tmp->list.next; tt_req_node_tmp = (struct batadv_tt_req_node *)__mptr___0 + 0xfffffffffffffff0UL; ldv_50866: ; if ((unsigned long )(& tt_req_node_tmp->list) != (unsigned long )(& bat_priv->tt.req_list)) { goto ldv_50865; } else { } tmp___2 = kmalloc(32UL, 32U); tt_req_node = (struct batadv_tt_req_node *)tmp___2; if ((unsigned long )tt_req_node == (unsigned long )((struct batadv_tt_req_node *)0)) { goto unlock; } else { } ether_addr_copy((u8 *)(& tt_req_node->addr), (u8 const *)(& orig_node->orig)); tt_req_node->issued_at = jiffies; list_add(& tt_req_node->list, & bat_priv->tt.req_list); unlock: spin_unlock_bh(& bat_priv->tt.req_list_lock); return (tt_req_node); } } static int batadv_tt_local_valid(void const *entry_ptr , void const *data_ptr ) { struct batadv_tt_common_entry const *tt_common_entry ; { tt_common_entry = (struct batadv_tt_common_entry const *)entry_ptr; if (((int )tt_common_entry->flags & 512) != 0) { return (0); } else { } return (1); } } static int batadv_tt_global_valid(void const *entry_ptr , void const *data_ptr ) { struct batadv_tt_common_entry const *tt_common_entry ; struct batadv_tt_global_entry const *tt_global_entry ; struct batadv_orig_node const *orig_node ; struct batadv_tt_common_entry const *__mptr ; bool tmp ; { tt_common_entry = (struct batadv_tt_common_entry const *)entry_ptr; orig_node = (struct batadv_orig_node const *)data_ptr; if (((int )tt_common_entry->flags & 2) != 0 || ((int )tt_common_entry->flags & 2048) != 0) { return (0); } else { } __mptr = tt_common_entry; tt_global_entry = (struct batadv_tt_global_entry const *)((struct batadv_tt_global_entry *)__mptr); tmp = batadv_tt_global_entry_has_orig(tt_global_entry, orig_node); return ((int )tmp); } } static void batadv_tt_tvlv_generate(struct batadv_priv *bat_priv , struct batadv_hashtable *hash , void *tvlv_buff , uint16_t tt_len , int (*valid_cb)(void const * , void const * ) , void *cb_data ) { struct batadv_tt_common_entry *tt_common_entry ; struct batadv_tvlv_tt_change *tt_change ; struct hlist_head *head ; uint16_t tt_tot ; uint16_t tt_num_entries ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp___0 ; int tmp___1 ; __u16 tmp___2 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___3 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_common_entry *tmp___4 ; { tt_num_entries = 0U; tt_tot = batadv_tt_entries((int )tt_len); tt_change = (struct batadv_tvlv_tt_change *)tvlv_buff; rcu_read_lock(); i = 0U; goto ldv_50923; ldv_50922: head = hash->table + (unsigned long )i; _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp___0 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___0; goto ldv_50921; ldv_50920: ; if ((int )tt_tot == (int )tt_num_entries) { goto ldv_50918; } else { } if ((unsigned long )valid_cb != (unsigned long )((int (*)(void const * , void const * ))0)) { tmp___1 = (*valid_cb)((void const *)tt_common_entry, (void const *)cb_data); if (tmp___1 == 0) { goto ldv_50919; } else { } } else { } ether_addr_copy((u8 *)(& tt_change->addr), (u8 const *)(& tt_common_entry->addr)); tt_change->flags = (uint8_t )tt_common_entry->flags; tmp___2 = __fswab16((int )tt_common_entry->vid); tt_change->vid = tmp___2; memset((void *)(& tt_change->reserved), 0, 3UL); tt_num_entries = (uint16_t )((int )tt_num_entries + 1); tt_change = tt_change + 1; ldv_50919: _________p1___0 = *((struct hlist_node * volatile *)(& tt_common_entry->hash_entry.next)); tmp___3 = debug_lockdep_rcu_enabled(); if (tmp___3 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_tt_common_entry *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___4 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___4; ldv_50921: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { goto ldv_50920; } else { } ldv_50918: i = i + 1U; ldv_50923: ; if (hash->size > i) { goto ldv_50922; } else { } rcu_read_unlock(); return; } } static bool batadv_tt_global_check_crc(struct batadv_orig_node *orig_node , struct batadv_tvlv_tt_vlan_data *tt_vlan , uint16_t num_vlan ) { struct batadv_tvlv_tt_vlan_data *tt_vlan_tmp ; struct batadv_orig_node_vlan *vlan ; uint32_t crc ; int i ; __u16 tmp ; bool tmp___0 ; __u16 tmp___1 ; __u32 tmp___2 ; { i = 0; goto ldv_50936; ldv_50935: tt_vlan_tmp = tt_vlan + (unsigned long )i; tmp = __fswab16((int )tt_vlan_tmp->vid); tmp___0 = batadv_bla_is_backbone_gw_orig(orig_node->bat_priv, (uint8_t *)(& orig_node->orig), (int )tmp); if ((int )tmp___0) { goto ldv_50934; } else { } tmp___1 = __fswab16((int )tt_vlan_tmp->vid); vlan = batadv_orig_node_vlan_get(orig_node, (int )tmp___1); if ((unsigned long )vlan == (unsigned long )((struct batadv_orig_node_vlan *)0)) { return (0); } else { } crc = vlan->tt.crc; batadv_orig_node_vlan_free_ref(vlan); tmp___2 = __fswab32(tt_vlan_tmp->crc); if (tmp___2 != crc) { return (0); } else { } ldv_50934: i = i + 1; ldv_50936: ; if ((int )num_vlan > i) { goto ldv_50935; } else { } return (1); } } static void batadv_tt_local_update_crc(struct batadv_priv *bat_priv ) { struct batadv_softif_vlan *vlan ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_softif_vlan *tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___1 ; struct hlist_node const *__mptr___0 ; struct batadv_softif_vlan *tmp___2 ; { rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->softif_vlan_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_softif_vlan *)__mptr + 0xffffffffffffffe0UL; } else { tmp___0 = (struct batadv_softif_vlan *)0; } vlan = tmp___0; goto ldv_50963; ldv_50962: vlan->tt.crc = batadv_tt_local_crc(bat_priv, (int )vlan->vid); _________p1___0 = *((struct hlist_node * volatile *)(& vlan->list.next)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_softif_vlan *)__mptr___0 + 0xffffffffffffffe0UL; } else { tmp___2 = (struct batadv_softif_vlan *)0; } vlan = tmp___2; ldv_50963: ; if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { goto ldv_50962; } else { } rcu_read_unlock(); return; } } static void batadv_tt_global_update_crc(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node ) { struct batadv_orig_node_vlan *vlan ; uint32_t crc ; struct list_head *__ptr ; struct list_head const *__mptr ; struct list_head *_________p1 ; bool __warned ; int tmp ; bool tmp___0 ; struct list_head *__ptr___0 ; struct list_head const *__mptr___0 ; struct list_head *_________p1___0 ; bool __warned___0 ; int tmp___1 ; { rcu_read_lock(); __ptr = orig_node->vlan_list.next; _________p1 = *((struct list_head * volatile *)(& __ptr)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } __mptr = (struct list_head const *)_________p1; vlan = (struct batadv_orig_node_vlan *)__mptr + 0xfffffffffffffff0UL; goto ldv_50987; ldv_50986: tmp___0 = batadv_bla_is_backbone_gw_orig(bat_priv, (uint8_t *)(& orig_node->orig), (int )vlan->vid); if ((int )tmp___0) { goto ldv_50985; } else { } crc = batadv_tt_global_crc(bat_priv, orig_node, (int )vlan->vid); vlan->tt.crc = crc; ldv_50985: __ptr___0 = vlan->list.next; _________p1___0 = *((struct list_head * volatile *)(& __ptr___0)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } __mptr___0 = (struct list_head const *)_________p1___0; vlan = (struct batadv_orig_node_vlan *)__mptr___0 + 0xfffffffffffffff0UL; ldv_50987: ; if ((unsigned long )(& vlan->list) != (unsigned long )(& orig_node->vlan_list)) { goto ldv_50986; } else { } rcu_read_unlock(); return; } } static int batadv_send_tt_request(struct batadv_priv *bat_priv , struct batadv_orig_node *dst_orig_node , uint8_t ttvn , struct batadv_tvlv_tt_vlan_data *tt_vlan , uint16_t num_vlan , bool full_table ) { struct batadv_tvlv_tt_data *tvlv_tt_data ; struct batadv_tt_req_node *tt_req_node ; struct batadv_tvlv_tt_vlan_data *tt_vlan_req ; struct batadv_hard_iface *primary_if ; bool ret ; int i ; int size ; void *tmp ; __u16 tmp___0 ; int tmp___1 ; { tvlv_tt_data = (struct batadv_tvlv_tt_data *)0; tt_req_node = (struct batadv_tt_req_node *)0; ret = 0; primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } tt_req_node = batadv_new_tt_req_node(bat_priv, dst_orig_node); if ((unsigned long )tt_req_node == (unsigned long )((struct batadv_tt_req_node *)0)) { goto out; } else { } size = (int )((unsigned int )num_vlan * 8U + 4U); tmp = kzalloc((size_t )size, 32U); tvlv_tt_data = (struct batadv_tvlv_tt_data *)tmp; if ((unsigned long )tvlv_tt_data == (unsigned long )((struct batadv_tvlv_tt_data *)0)) { goto out; } else { } tvlv_tt_data->flags = 2U; tvlv_tt_data->ttvn = ttvn; tmp___0 = __fswab16((int )num_vlan); tvlv_tt_data->num_vlan = tmp___0; tt_vlan_req = (struct batadv_tvlv_tt_vlan_data *)tvlv_tt_data + 1U; i = 0; goto ldv_51006; ldv_51005: tt_vlan_req->vid = tt_vlan->vid; tt_vlan_req->crc = tt_vlan->crc; tt_vlan_req = tt_vlan_req + 1; tt_vlan = tt_vlan + 1; i = i + 1; ldv_51006: ; if ((int )num_vlan > i) { goto ldv_51005; } else { } if ((int )full_table) { tvlv_tt_data->flags = (uint8_t )((unsigned int )tvlv_tt_data->flags | 16U); } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 4) != 0) { batadv_debug_log(bat_priv, "Sending TT_REQUEST to %pM [%c]\n", (uint8_t *)(& dst_orig_node->orig), (int )full_table ? 70 : 46); } else { } batadv_add_counter___0(bat_priv, 17UL, 1UL); batadv_tvlv_unicast_send(bat_priv, (primary_if->net_dev)->dev_addr, (uint8_t *)(& dst_orig_node->orig), 4, 1, (void *)tvlv_tt_data, (int )((uint16_t )size)); ret = 1; out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } if ((int )ret && (unsigned long )tt_req_node != (unsigned long )((struct batadv_tt_req_node *)0)) { spin_lock_bh(& bat_priv->tt.req_list_lock); list_del(& tt_req_node->list); spin_unlock_bh(& bat_priv->tt.req_list_lock); kfree((void const *)tt_req_node); } else { } kfree((void const *)tvlv_tt_data); return ((int )ret); } } static bool batadv_send_other_tt_response(struct batadv_priv *bat_priv , struct batadv_tvlv_tt_data *tt_data , uint8_t *req_src , uint8_t *req_dst ) { struct batadv_orig_node *req_dst_orig_node ; struct batadv_orig_node *res_dst_orig_node ; struct batadv_tvlv_tt_change *tt_change ; struct batadv_tvlv_tt_data *tvlv_tt_data ; struct batadv_tvlv_tt_vlan_data *tt_vlan ; bool ret ; bool full_table ; uint8_t orig_ttvn ; uint8_t req_ttvn ; uint16_t tvlv_len ; int32_t tt_len ; int tmp ; int tmp___0 ; __u16 tmp___1 ; bool tmp___2 ; int tmp___3 ; size_t __len ; void *__ret ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; { res_dst_orig_node = (struct batadv_orig_node *)0; tvlv_tt_data = (struct batadv_tvlv_tt_data *)0; ret = 0; tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 4) != 0) { batadv_debug_log(bat_priv, "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n", req_src, (int )tt_data->ttvn, req_dst, ((int )tt_data->flags & 16) != 0 ? 70 : 46); } else { } req_dst_orig_node = batadv_orig_hash_find___6(bat_priv, (void const *)req_dst); if ((unsigned long )req_dst_orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } res_dst_orig_node = batadv_orig_hash_find___6(bat_priv, (void const *)req_src); if ((unsigned long )res_dst_orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } tmp___0 = atomic_read((atomic_t const *)(& req_dst_orig_node->last_ttvn)); orig_ttvn = (unsigned char )tmp___0; req_ttvn = tt_data->ttvn; tt_vlan = (struct batadv_tvlv_tt_vlan_data *)tt_data + 1U; if ((int )orig_ttvn != (int )req_ttvn) { goto out; } else { tmp___1 = __fswab16((int )tt_data->num_vlan); tmp___2 = batadv_tt_global_check_crc(req_dst_orig_node, tt_vlan, (int )tmp___1); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { goto out; } else { } } if (((int )tt_data->flags & 16) != 0 || (unsigned long )req_dst_orig_node->tt_buff == (unsigned long )((unsigned char *)0U)) { full_table = 1; } else { full_table = 0; } if (! full_table) { spin_lock_bh(& req_dst_orig_node->tt_buff_lock); tt_len = (int32_t )req_dst_orig_node->tt_buff_len; tvlv_len = batadv_tt_prepare_tvlv_global_data(req_dst_orig_node, & tvlv_tt_data, & tt_change, & tt_len); if (tt_len == 0) { goto unlock; } else { } __len = (size_t )req_dst_orig_node->tt_buff_len; __ret = __builtin_memcpy((void *)tt_change, (void const *)req_dst_orig_node->tt_buff, __len); spin_unlock_bh(& req_dst_orig_node->tt_buff_lock); } else { tt_len = -1; tvlv_len = batadv_tt_prepare_tvlv_global_data(req_dst_orig_node, & tvlv_tt_data, & tt_change, & tt_len); if (tt_len == 0) { goto out; } else { } batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.global_hash, (void *)tt_change, (int )((uint16_t )tt_len), & batadv_tt_global_valid, (void *)req_dst_orig_node); } tt_len = (int32_t )((unsigned int )tvlv_len + 20U); tmp___7 = atomic_read((atomic_t const *)(& bat_priv->packet_size_max)); if (tmp___7 < tt_len) { tmp___6 = net_ratelimit(); if (tmp___6 != 0) { _netdev = bat_priv->soft_iface; tmp___4 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___4; tmp___5 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___5 & 63) != 0) { batadv_debug_log(_batpriv, "Ignoring TT_REQUEST from %pM; Response size exceeds max packet size.\n", (uint8_t *)(& res_dst_orig_node->orig)); } else { } printk("\016batman_adv: %s: Ignoring TT_REQUEST from %pM; Response size exceeds max packet size.\n", (char *)(& _netdev->name), (uint8_t *)(& res_dst_orig_node->orig)); } else { } goto out; } else { } tvlv_tt_data->flags = 4U; tvlv_tt_data->ttvn = req_ttvn; if ((int )full_table) { tvlv_tt_data->flags = (uint8_t )((unsigned int )tvlv_tt_data->flags | 16U); } else { } tmp___8 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___8 & 4) != 0) { batadv_debug_log(bat_priv, "Sending TT_RESPONSE %pM for %pM [%c] (ttvn: %u)\n", (uint8_t *)(& res_dst_orig_node->orig), (uint8_t *)(& req_dst_orig_node->orig), (int )full_table ? 70 : 46, (int )req_ttvn); } else { } batadv_add_counter___0(bat_priv, 19UL, 1UL); batadv_tvlv_unicast_send(bat_priv, (uint8_t *)(& req_dst_orig_node->orig), req_src, 4, 1, (void *)tvlv_tt_data, (int )tvlv_len); ret = 1; goto out; unlock: spin_unlock_bh(& req_dst_orig_node->tt_buff_lock); out: ; if ((unsigned long )res_dst_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(res_dst_orig_node); } else { } if ((unsigned long )req_dst_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(req_dst_orig_node); } else { } kfree((void const *)tvlv_tt_data); return (ret); } } static bool batadv_send_my_tt_response(struct batadv_priv *bat_priv , struct batadv_tvlv_tt_data *tt_data , uint8_t *req_src ) { struct batadv_tvlv_tt_data *tvlv_tt_data ; struct batadv_hard_iface *primary_if ; struct batadv_tvlv_tt_change *tt_change ; struct batadv_orig_node *orig_node ; uint8_t my_ttvn ; uint8_t req_ttvn ; uint16_t tvlv_len ; bool full_table ; int32_t tt_len ; int tmp ; int tmp___0 ; size_t __len ; void *__ret ; int tmp___1 ; int tmp___2 ; { tvlv_tt_data = (struct batadv_tvlv_tt_data *)0; primary_if = (struct batadv_hard_iface *)0; tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 4) != 0) { batadv_debug_log(bat_priv, "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n", req_src, (int )tt_data->ttvn, ((int )tt_data->flags & 16) != 0 ? 70 : 46); } else { } spin_lock_bh(& bat_priv->tt.commit_lock); tmp___0 = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); my_ttvn = (unsigned char )tmp___0; req_ttvn = tt_data->ttvn; orig_node = batadv_orig_hash_find___6(bat_priv, (void const *)req_src); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } if ((((int )tt_data->flags & 16) != 0 || (int )my_ttvn != (int )req_ttvn) || (unsigned long )bat_priv->tt.last_changeset == (unsigned long )((unsigned char *)0U)) { full_table = 1; } else { full_table = 0; } if (! full_table) { spin_lock_bh(& bat_priv->tt.last_changeset_lock); tt_len = (int32_t )bat_priv->tt.last_changeset_len; tvlv_len = batadv_tt_prepare_tvlv_local_data(bat_priv, & tvlv_tt_data, & tt_change, & tt_len); if (tt_len == 0) { goto unlock; } else { } __len = (size_t )bat_priv->tt.last_changeset_len; __ret = __builtin_memcpy((void *)tt_change, (void const *)bat_priv->tt.last_changeset, __len); spin_unlock_bh(& bat_priv->tt.last_changeset_lock); } else { tmp___1 = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); req_ttvn = (unsigned char )tmp___1; tt_len = -1; tvlv_len = batadv_tt_prepare_tvlv_local_data(bat_priv, & tvlv_tt_data, & tt_change, & tt_len); if (tt_len == 0) { goto out; } else { } batadv_tt_tvlv_generate(bat_priv, bat_priv->tt.local_hash, (void *)tt_change, (int )((uint16_t )tt_len), & batadv_tt_local_valid, (void *)0); } tvlv_tt_data->flags = 4U; tvlv_tt_data->ttvn = req_ttvn; if ((int )full_table) { tvlv_tt_data->flags = (uint8_t )((unsigned int )tvlv_tt_data->flags | 16U); } else { } tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 4) != 0) { batadv_debug_log(bat_priv, "Sending TT_RESPONSE to %pM [%c] (ttvn: %u)\n", (uint8_t *)(& orig_node->orig), (int )full_table ? 70 : 46, (int )req_ttvn); } else { } batadv_add_counter___0(bat_priv, 19UL, 1UL); batadv_tvlv_unicast_send(bat_priv, (primary_if->net_dev)->dev_addr, req_src, 4, 1, (void *)tvlv_tt_data, (int )tvlv_len); goto out; unlock: spin_unlock_bh(& bat_priv->tt.last_changeset_lock); out: spin_unlock_bh(& bat_priv->tt.commit_lock); if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } kfree((void const *)tvlv_tt_data); return (1); } } static bool batadv_send_tt_response(struct batadv_priv *bat_priv , struct batadv_tvlv_tt_data *tt_data , uint8_t *req_src , uint8_t *req_dst ) { bool tmp ; bool tmp___0 ; int tmp___1 ; { tmp___1 = batadv_is_my_mac(bat_priv, (uint8_t const *)req_dst); if (tmp___1 != 0) { tmp = batadv_send_my_tt_response(bat_priv, tt_data, req_src); return (tmp); } else { tmp___0 = batadv_send_other_tt_response(bat_priv, tt_data, req_src, req_dst); return (tmp___0); } } } static void _batadv_tt_update_changes(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , struct batadv_tvlv_tt_change *tt_change , uint16_t tt_num_changes , uint8_t ttvn ) { int i ; int roams ; __u16 tmp ; __u16 tmp___0 ; bool tmp___1 ; int tmp___2 ; { i = 0; goto ldv_51067; ldv_51066: ; if ((int )(tt_change + (unsigned long )i)->flags & 1) { roams = (int )(tt_change + (unsigned long )i)->flags & 2; tmp = __fswab16((int )(tt_change + (unsigned long )i)->vid); batadv_tt_global_del(bat_priv, orig_node, (unsigned char const *)(& (tt_change + (unsigned long )i)->addr), (int )tmp, "tt removed by changes", roams != 0); } else { tmp___0 = __fswab16((int )(tt_change + (unsigned long )i)->vid); tmp___1 = batadv_tt_global_add(bat_priv, orig_node, (unsigned char const *)(& (tt_change + (unsigned long )i)->addr), (int )tmp___0, (int )(tt_change + (unsigned long )i)->flags, (int )ttvn); if (tmp___1) { tmp___2 = 0; } else { tmp___2 = 1; } if (tmp___2) { return; } else { } } i = i + 1; ldv_51067: ; if ((int )tt_num_changes > i) { goto ldv_51066; } else { } orig_node->capa_initialized = (uint8_t )((unsigned int )orig_node->capa_initialized | 4U); return; } } static void batadv_tt_fill_gtable(struct batadv_priv *bat_priv , struct batadv_tvlv_tt_change *tt_change , uint8_t ttvn , uint8_t *resp_src , uint16_t num_entries ) { struct batadv_orig_node *orig_node ; { orig_node = batadv_orig_hash_find___6(bat_priv, (void const *)resp_src); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } batadv_tt_global_del_orig(bat_priv, orig_node, -1, "Received full table"); _batadv_tt_update_changes(bat_priv, orig_node, tt_change, (int )num_entries, (int )ttvn); spin_lock_bh(& orig_node->tt_buff_lock); kfree((void const *)orig_node->tt_buff); orig_node->tt_buff_len = 0; orig_node->tt_buff = (unsigned char *)0U; spin_unlock_bh(& orig_node->tt_buff_lock); atomic_set(& orig_node->last_ttvn, (int )ttvn); out: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return; } } static void batadv_tt_update_changes(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , uint16_t tt_num_changes , uint8_t ttvn , struct batadv_tvlv_tt_change *tt_change ) { int tmp ; { _batadv_tt_update_changes(bat_priv, orig_node, tt_change, (int )tt_num_changes, (int )ttvn); tmp = batadv_tt_len((int )tt_num_changes); batadv_tt_save_orig_buffer(bat_priv, orig_node, (void const *)tt_change, (int )((uint16_t )tmp)); atomic_set(& orig_node->last_ttvn, (int )ttvn); return; } } bool batadv_is_my_client(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) { struct batadv_tt_local_entry *tt_local_entry ; bool ret ; { ret = 0; tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, (int )vid); if ((unsigned long )tt_local_entry == (unsigned long )((struct batadv_tt_local_entry *)0)) { goto out; } else { } if (((int )tt_local_entry->common.flags & 1024) != 0 || ((int )tt_local_entry->common.flags & 2) != 0) { goto out; } else { } ret = 1; out: ; if ((unsigned long )tt_local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_local_entry_free_ref(tt_local_entry); } else { } return (ret); } } static void batadv_handle_tt_response(struct batadv_priv *bat_priv , struct batadv_tvlv_tt_data *tt_data , uint8_t *resp_src , uint16_t num_entries ) { struct batadv_tt_req_node *node ; struct batadv_tt_req_node *safe ; struct batadv_orig_node *orig_node ; struct batadv_tvlv_tt_change *tt_change ; uint8_t *tvlv_ptr ; uint16_t change_offset ; int tmp ; __u16 tmp___0 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp___1 ; struct list_head const *__mptr___1 ; { orig_node = (struct batadv_orig_node *)0; tvlv_ptr = (uint8_t *)tt_data; tmp = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp & 4) != 0) { batadv_debug_log(bat_priv, "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n", resp_src, (int )tt_data->ttvn, (int )num_entries, ((int )tt_data->flags & 16) != 0 ? 70 : 46); } else { } orig_node = batadv_orig_hash_find___6(bat_priv, (void const *)resp_src); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } spin_lock_bh(& orig_node->tt_lock); change_offset = 8U; tmp___0 = __fswab16((int )tt_data->num_vlan); change_offset = (int )tmp___0 * (int )change_offset; change_offset = (unsigned int )change_offset + 4U; tvlv_ptr = tvlv_ptr + (unsigned long )change_offset; tt_change = (struct batadv_tvlv_tt_change *)tvlv_ptr; if (((int )tt_data->flags & 16) != 0) { batadv_tt_fill_gtable(bat_priv, tt_change, (int )tt_data->ttvn, resp_src, (int )num_entries); } else { batadv_tt_update_changes(bat_priv, orig_node, (int )num_entries, (int )tt_data->ttvn, tt_change); } batadv_tt_global_update_crc(bat_priv, orig_node); spin_unlock_bh(& orig_node->tt_lock); spin_lock_bh(& bat_priv->tt.req_list_lock); __mptr = (struct list_head const *)bat_priv->tt.req_list.next; node = (struct batadv_tt_req_node *)__mptr + 0xfffffffffffffff0UL; __mptr___0 = (struct list_head const *)node->list.next; safe = (struct batadv_tt_req_node *)__mptr___0 + 0xfffffffffffffff0UL; goto ldv_51114; ldv_51113: tmp___1 = batadv_compare_eth((void const *)(& node->addr), (void const *)resp_src); if (tmp___1 == 0) { goto ldv_51112; } else { } list_del(& node->list); kfree((void const *)node); ldv_51112: node = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_req_node *)__mptr___1 + 0xfffffffffffffff0UL; ldv_51114: ; if ((unsigned long )(& node->list) != (unsigned long )(& bat_priv->tt.req_list)) { goto ldv_51113; } else { } spin_unlock_bh(& bat_priv->tt.req_list_lock); out: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return; } } static void batadv_tt_roam_list_free(struct batadv_priv *bat_priv ) { struct batadv_tt_roam_node *node ; struct batadv_tt_roam_node *safe ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; { spin_lock_bh(& bat_priv->tt.roam_list_lock); __mptr = (struct list_head const *)bat_priv->tt.roam_list.next; node = (struct batadv_tt_roam_node *)__mptr + 0xffffffffffffffe8UL; __mptr___0 = (struct list_head const *)node->list.next; safe = (struct batadv_tt_roam_node *)__mptr___0 + 0xffffffffffffffe8UL; goto ldv_51128; ldv_51127: list_del(& node->list); kfree((void const *)node); node = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_roam_node *)__mptr___1 + 0xffffffffffffffe8UL; ldv_51128: ; if ((unsigned long )(& node->list) != (unsigned long )(& bat_priv->tt.roam_list)) { goto ldv_51127; } else { } spin_unlock_bh(& bat_priv->tt.roam_list_lock); return; } } static void batadv_tt_roam_purge(struct batadv_priv *bat_priv ) { struct batadv_tt_roam_node *node ; struct batadv_tt_roam_node *safe ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; bool tmp ; int tmp___0 ; struct list_head const *__mptr___1 ; { spin_lock_bh(& bat_priv->tt.roam_list_lock); __mptr = (struct list_head const *)bat_priv->tt.roam_list.next; node = (struct batadv_tt_roam_node *)__mptr + 0xffffffffffffffe8UL; __mptr___0 = (struct list_head const *)node->list.next; safe = (struct batadv_tt_roam_node *)__mptr___0 + 0xffffffffffffffe8UL; goto ldv_51143; ldv_51142: tmp = batadv_has_timed_out(node->first_time, 20000U); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto ldv_51141; } else { } list_del(& node->list); kfree((void const *)node); ldv_51141: node = safe; __mptr___1 = (struct list_head const *)safe->list.next; safe = (struct batadv_tt_roam_node *)__mptr___1 + 0xffffffffffffffe8UL; ldv_51143: ; if ((unsigned long )(& node->list) != (unsigned long )(& bat_priv->tt.roam_list)) { goto ldv_51142; } else { } spin_unlock_bh(& bat_priv->tt.roam_list_lock); return; } } static bool batadv_tt_check_roam_count(struct batadv_priv *bat_priv , uint8_t *client ) { struct batadv_tt_roam_node *tt_roam_node ; bool ret ; struct list_head const *__mptr ; int tmp ; bool tmp___0 ; int tmp___1 ; struct list_head const *__mptr___0 ; void *tmp___2 ; { ret = 0; spin_lock_bh(& bat_priv->tt.roam_list_lock); __mptr = (struct list_head const *)bat_priv->tt.roam_list.next; tt_roam_node = (struct batadv_tt_roam_node *)__mptr + 0xffffffffffffffe8UL; goto ldv_51159; ldv_51158: tmp = batadv_compare_eth((void const *)(& tt_roam_node->addr), (void const *)client); if (tmp == 0) { goto ldv_51155; } else { } tmp___0 = batadv_has_timed_out(tt_roam_node->first_time, 20000U); if ((int )tmp___0) { goto ldv_51155; } else { } tmp___1 = atomic_add_unless(& tt_roam_node->counter, -1, 0); if (tmp___1 == 0) { goto unlock; } else { } ret = 1; goto ldv_51157; ldv_51155: __mptr___0 = (struct list_head const *)tt_roam_node->list.next; tt_roam_node = (struct batadv_tt_roam_node *)__mptr___0 + 0xffffffffffffffe8UL; ldv_51159: ; if ((unsigned long )(& tt_roam_node->list) != (unsigned long )(& bat_priv->tt.roam_list)) { goto ldv_51158; } else { } ldv_51157: ; if (! ret) { tmp___2 = kmalloc(40UL, 32U); tt_roam_node = (struct batadv_tt_roam_node *)tmp___2; if ((unsigned long )tt_roam_node == (unsigned long )((struct batadv_tt_roam_node *)0)) { goto unlock; } else { } tt_roam_node->first_time = jiffies; atomic_set(& tt_roam_node->counter, 4); ether_addr_copy((u8 *)(& tt_roam_node->addr), (u8 const *)client); list_add(& tt_roam_node->list, & bat_priv->tt.roam_list); ret = 1; } else { } unlock: spin_unlock_bh(& bat_priv->tt.roam_list_lock); return (ret); } } static void batadv_send_roam_adv(struct batadv_priv *bat_priv , uint8_t *client , unsigned short vid , struct batadv_orig_node *orig_node ) { struct batadv_hard_iface *primary_if ; struct batadv_tvlv_roam_adv tvlv_roam ; bool tmp ; int tmp___0 ; int tmp___1 ; size_t __len ; void *__ret ; __u16 tmp___2 ; { primary_if = batadv_primary_if_get_selected(bat_priv); if ((unsigned long )primary_if == (unsigned long )((struct batadv_hard_iface *)0)) { goto out; } else { } tmp = batadv_tt_check_roam_count(bat_priv, client); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto out; } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___1 & 4) != 0) { batadv_debug_log(bat_priv, "Sending ROAMING_ADV to %pM (client %pM, vid: %d)\n", (uint8_t *)(& orig_node->orig), client, (int )((short )vid) < 0 ? (int )vid & 4095 : -1); } else { } batadv_add_counter___0(bat_priv, 21UL, 1UL); __len = 6UL; if (__len > 63UL) { __ret = __memcpy((void *)(& tvlv_roam.client), (void const *)client, __len); } else { __ret = __builtin_memcpy((void *)(& tvlv_roam.client), (void const *)client, __len); } tmp___2 = __fswab16((int )vid); tvlv_roam.vid = tmp___2; batadv_tvlv_unicast_send(bat_priv, (primary_if->net_dev)->dev_addr, (uint8_t *)(& orig_node->orig), 5, 1, (void *)(& tvlv_roam), 8); out: ; if ((unsigned long )primary_if != (unsigned long )((struct batadv_hard_iface *)0)) { batadv_hardif_free_ref(primary_if); } else { } return; } } static void batadv_tt_purge(struct work_struct *work ) { struct delayed_work *delayed_work ; struct batadv_priv_tt *priv_tt ; struct batadv_priv *bat_priv ; struct work_struct const *__mptr ; struct delayed_work const *__mptr___0 ; struct batadv_priv_tt const *__mptr___1 ; unsigned long tmp ; { __mptr = (struct work_struct const *)work; delayed_work = (struct delayed_work *)__mptr; __mptr___0 = (struct delayed_work const *)delayed_work; priv_tt = (struct batadv_priv_tt *)__mptr___0 + 0xfffffffffffffe38UL; __mptr___1 = (struct batadv_priv_tt const *)priv_tt; bat_priv = (struct batadv_priv *)__mptr___1 + 0xfffffffffffff958UL; batadv_tt_local_purge(bat_priv, 600000); batadv_tt_global_purge(bat_priv); batadv_tt_req_purge(bat_priv); batadv_tt_roam_purge(bat_priv); tmp = msecs_to_jiffies(5000U); queue_delayed_work(batadv_event_workqueue, & bat_priv->tt.work, tmp); return; } } void batadv_tt_free(struct batadv_priv *bat_priv ) { { batadv_tvlv_container_unregister(bat_priv, 4, 1); batadv_tvlv_handler_unregister(bat_priv, 4, 1); cancel_delayed_work_sync(& bat_priv->tt.work); batadv_tt_local_table_free(bat_priv); batadv_tt_global_table_free(bat_priv); batadv_tt_req_list_free(bat_priv); batadv_tt_changes_list_free(bat_priv); batadv_tt_roam_list_free(bat_priv); kfree((void const *)bat_priv->tt.last_changeset); return; } } static void batadv_tt_local_set_flags(struct batadv_priv *bat_priv , uint16_t flags , bool enable , bool count ) { struct batadv_hashtable *hash ; struct batadv_tt_common_entry *tt_common_entry ; uint16_t changed_num ; struct hlist_head *head ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___1 ; struct hlist_node const *__mptr___0 ; struct batadv_tt_common_entry *tmp___2 ; { hash = bat_priv->tt.local_hash; changed_num = 0U; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0U; goto ldv_51223; ldv_51222: head = hash->table + (unsigned long )i; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& head->first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp___0 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___0; goto ldv_51220; ldv_51219: ; if ((int )enable) { if (((int )tt_common_entry->flags & (int )flags) == (int )flags) { goto ldv_51218; } else { } tt_common_entry->flags = (uint16_t )((int )tt_common_entry->flags | (int )flags); } else { if ((unsigned int )((int )tt_common_entry->flags & (int )flags) == 0U) { goto ldv_51218; } else { } tt_common_entry->flags = (uint16_t )((int )((short )tt_common_entry->flags) & ~ ((int )((short )flags))); } changed_num = (uint16_t )((int )changed_num + 1); if (! count) { goto ldv_51218; } else { } batadv_tt_local_size_inc(bat_priv, (int )tt_common_entry->vid); ldv_51218: _________p1___0 = *((struct hlist_node * volatile *)(& tt_common_entry->hash_entry.next)); tmp___1 = debug_lockdep_rcu_enabled(); if (tmp___1 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_tt_common_entry *)__mptr___0 + 0xfffffffffffffff8UL; } else { tmp___2 = (struct batadv_tt_common_entry *)0; } tt_common_entry = tmp___2; ldv_51220: ; if ((unsigned long )tt_common_entry != (unsigned long )((struct batadv_tt_common_entry *)0)) { goto ldv_51219; } else { } rcu_read_unlock(); i = i + 1U; ldv_51223: ; if (hash->size > i) { goto ldv_51222; } else { } return; } } static void batadv_tt_local_purge_pending_clients(struct batadv_priv *bat_priv ) { struct batadv_hashtable *hash ; struct batadv_tt_common_entry *tt_common ; struct batadv_tt_local_entry *tt_local ; struct hlist_node *node_tmp ; struct hlist_head *head ; spinlock_t *list_lock ; uint32_t i ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_tt_common_entry *tmp ; int tmp___0 ; struct batadv_tt_common_entry const *__mptr___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___1 ; struct batadv_tt_common_entry *tmp___1 ; { hash = bat_priv->tt.local_hash; if ((unsigned long )hash == (unsigned long )((struct batadv_hashtable *)0)) { return; } else { } i = 0U; goto ldv_51251; ldv_51250: head = hash->table + (unsigned long )i; list_lock = hash->list_locks + (unsigned long )i; spin_lock_bh(list_lock); ____ptr = head->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_tt_common_entry *)__mptr + 0xfffffffffffffff8UL; } else { tmp = (struct batadv_tt_common_entry *)0; } tt_common = tmp; goto ldv_51248; ldv_51247: ; if (((int )tt_common->flags & 1024) == 0) { goto ldv_51244; } else { } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 4) != 0) { batadv_debug_log(bat_priv, "Deleting local tt entry (%pM, vid: %d): pending\n", (uint8_t *)(& tt_common->addr), (int )((short )tt_common->vid) < 0 ? (int )tt_common->vid & 4095 : -1); } else { } batadv_tt_local_size_dec(bat_priv, (int )tt_common->vid); hlist_del_rcu(& tt_common->hash_entry); __mptr___0 = (struct batadv_tt_common_entry const *)tt_common; tt_local = (struct batadv_tt_local_entry *)__mptr___0; batadv_tt_local_entry_free_ref(tt_local); ldv_51244: ____ptr___0 = node_tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___1 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_tt_common_entry *)__mptr___1 + 0xfffffffffffffff8UL; } else { tmp___1 = (struct batadv_tt_common_entry *)0; } tt_common = tmp___1; ldv_51248: ; if ((unsigned long )tt_common != (unsigned long )((struct batadv_tt_common_entry *)0)) { node_tmp = tt_common->hash_entry.next; goto ldv_51247; } else { } spin_unlock_bh(list_lock); i = i + 1U; ldv_51251: ; if (hash->size > i) { goto ldv_51250; } else { } return; } } static void batadv_tt_local_commit_changes_nolock(struct batadv_priv *bat_priv ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { batadv_mcast_mla_update(bat_priv); tmp___0 = atomic_read((atomic_t const *)(& bat_priv->tt.local_changes)); if (tmp___0 <= 0) { tmp = atomic_add_unless(& bat_priv->tt.ogm_append_cnt, -1, 0); if (tmp == 0) { batadv_tt_tvlv_container_update(bat_priv); } else { } return; } else { } batadv_tt_local_set_flags(bat_priv, 512, 0, 1); batadv_tt_local_purge_pending_clients(bat_priv); batadv_tt_local_update_crc(bat_priv); atomic_inc(& bat_priv->tt.vn); tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 4) != 0) { tmp___1 = atomic_read((atomic_t const *)(& bat_priv->tt.vn)); batadv_debug_log(bat_priv, "Local changes committed, updating to ttvn %u\n", (int )((unsigned char )tmp___1)); } else { } atomic_set(& bat_priv->tt.ogm_append_cnt, 3); batadv_tt_tvlv_container_update(bat_priv); return; } } void batadv_tt_local_commit_changes(struct batadv_priv *bat_priv ) { { spin_lock_bh(& bat_priv->tt.commit_lock); batadv_tt_local_commit_changes_nolock(bat_priv); spin_unlock_bh(& bat_priv->tt.commit_lock); return; } } bool batadv_is_ap_isolated(struct batadv_priv *bat_priv , uint8_t *src , uint8_t *dst , unsigned short vid ) { struct batadv_tt_local_entry *tt_local_entry ; struct batadv_tt_global_entry *tt_global_entry ; struct batadv_softif_vlan *vlan ; bool ret ; int tmp ; bool tmp___0 ; int tmp___1 ; { tt_local_entry = (struct batadv_tt_local_entry *)0; tt_global_entry = (struct batadv_tt_global_entry *)0; ret = 0; vlan = batadv_softif_vlan_get(bat_priv, (int )vid); if ((unsigned long )vlan == (unsigned long )((struct batadv_softif_vlan *)0)) { goto out; } else { tmp = atomic_read((atomic_t const *)(& vlan->ap_isolation)); if (tmp == 0) { goto out; } else { } } tt_local_entry = batadv_tt_local_hash_find(bat_priv, (uint8_t const *)dst, (int )vid); if ((unsigned long )tt_local_entry == (unsigned long )((struct batadv_tt_local_entry *)0)) { goto out; } else { } tt_global_entry = batadv_tt_global_hash_find(bat_priv, (uint8_t const *)src, (int )vid); if ((unsigned long )tt_global_entry == (unsigned long )((struct batadv_tt_global_entry *)0)) { goto out; } else { } tmp___0 = _batadv_is_ap_isolated(tt_local_entry, tt_global_entry); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto out; } else { } ret = 1; out: ; if ((unsigned long )vlan != (unsigned long )((struct batadv_softif_vlan *)0)) { batadv_softif_vlan_free_ref(vlan); } else { } if ((unsigned long )tt_global_entry != (unsigned long )((struct batadv_tt_global_entry *)0)) { batadv_tt_global_entry_free_ref(tt_global_entry); } else { } if ((unsigned long )tt_local_entry != (unsigned long )((struct batadv_tt_local_entry *)0)) { batadv_tt_local_entry_free_ref(tt_local_entry); } else { } return (ret); } } static void batadv_tt_update_orig(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , void const *tt_buff , uint16_t tt_num_vlan , struct batadv_tvlv_tt_change *tt_change , uint16_t tt_num_changes , uint8_t ttvn ) { uint8_t orig_ttvn ; int tmp ; struct batadv_tvlv_tt_vlan_data *tt_vlan ; bool full_table ; bool has_tt_init ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; bool tmp___3 ; int tmp___4 ; { tmp = atomic_read((atomic_t const *)(& orig_node->last_ttvn)); orig_ttvn = (unsigned char )tmp; full_table = 1; tt_vlan = (struct batadv_tvlv_tt_vlan_data *)tt_buff; has_tt_init = ((int )orig_node->capa_initialized & 4) != 0; if ((! has_tt_init && (unsigned int )ttvn == 1U) || (int )ttvn - (int )orig_ttvn == 1) { if ((unsigned int )tt_num_changes == 0U) { full_table = 0; goto request_table; } else { } spin_lock_bh(& orig_node->tt_lock); batadv_tt_update_changes(bat_priv, orig_node, (int )tt_num_changes, (int )ttvn, tt_change); batadv_tt_global_update_crc(bat_priv, orig_node); spin_unlock_bh(& orig_node->tt_lock); tmp___0 = batadv_tt_global_check_crc(orig_node, tt_vlan, (int )tt_num_vlan); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto request_table; } else { } } else if (! has_tt_init || (int )ttvn != (int )orig_ttvn) { goto request_table; } else { tmp___3 = batadv_tt_global_check_crc(orig_node, tt_vlan, (int )tt_num_vlan); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { request_table: tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 4) != 0) { batadv_debug_log(bat_priv, "TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u num_changes: %u)\n", (uint8_t *)(& orig_node->orig), (int )ttvn, (int )orig_ttvn, (int )tt_num_changes); } else { } batadv_send_tt_request(bat_priv, orig_node, (int )ttvn, tt_vlan, (int )tt_num_vlan, (int )full_table); return; } else { } } return; } } bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv , uint8_t *addr , unsigned short vid ) { struct batadv_tt_global_entry *tt_global_entry ; bool ret ; { ret = 0; tt_global_entry = batadv_tt_global_hash_find(bat_priv, (uint8_t const *)addr, (int )vid); if ((unsigned long )tt_global_entry == (unsigned long )((struct batadv_tt_global_entry *)0)) { goto out; } else { } ret = ((int )tt_global_entry->common.flags & 2) != 0; batadv_tt_global_entry_free_ref(tt_global_entry); out: ; return (ret); } } bool batadv_tt_local_client_is_roaming(struct batadv_priv *bat_priv , uint8_t *addr , unsigned short vid ) { struct batadv_tt_local_entry *tt_local_entry ; bool ret ; { ret = 0; tt_local_entry = batadv_tt_local_hash_find(bat_priv, (uint8_t const *)addr, (int )vid); if ((unsigned long )tt_local_entry == (unsigned long )((struct batadv_tt_local_entry *)0)) { goto out; } else { } ret = ((int )tt_local_entry->common.flags & 2) != 0; batadv_tt_local_entry_free_ref(tt_local_entry); out: ; return (ret); } } bool batadv_tt_add_temporary_global_entry(struct batadv_priv *bat_priv , struct batadv_orig_node *orig_node , unsigned char const *addr , unsigned short vid ) { bool ret ; int tmp ; bool tmp___0 ; int tmp___1 ; int tmp___2 ; { ret = 0; tmp = atomic_read((atomic_t const *)(& orig_node->last_ttvn)); tmp___0 = batadv_tt_global_add(bat_priv, orig_node, addr, (int )vid, 2048, (int )((uint8_t )tmp)); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { goto out; } else { } tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 4) != 0) { batadv_debug_log(bat_priv, "Added temporary global client (addr: %pM, vid: %d, orig: %pM)\n", addr, (int )((short )vid) < 0 ? (int )vid & 4095 : -1, (uint8_t *)(& orig_node->orig)); } else { } ret = 1; out: ; return (ret); } } void batadv_tt_local_resize_to_mtu(struct net_device *soft_iface ) { struct batadv_priv *bat_priv ; void *tmp ; int packet_size_max ; int tmp___0 ; int table_size ; int timeout ; bool reduced ; struct net_device *_netdev ; struct batadv_priv *_batpriv ; void *tmp___1 ; int tmp___2 ; int tmp___3 ; { tmp = netdev_priv((struct net_device const *)soft_iface); bat_priv = (struct batadv_priv *)tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->packet_size_max)); packet_size_max = tmp___0; timeout = 300000; reduced = 0; spin_lock_bh(& bat_priv->tt.commit_lock); ldv_51319: table_size = batadv_tt_local_table_transmit_size(bat_priv); if (packet_size_max >= table_size) { goto ldv_51316; } else { } batadv_tt_local_purge(bat_priv, timeout); batadv_tt_local_purge_pending_clients(bat_priv); timeout = timeout / 2; reduced = 1; tmp___3 = net_ratelimit(); if (tmp___3 != 0) { _netdev = soft_iface; tmp___1 = netdev_priv((struct net_device const *)_netdev); _batpriv = (struct batadv_priv *)tmp___1; tmp___2 = atomic_read((atomic_t const *)(& _batpriv->log_level)); if ((tmp___2 & 63) != 0) { batadv_debug_log(_batpriv, "Forced to purge local tt entries to fit new maximum fragment MTU (%i)\n", packet_size_max); } else { } printk("\016batman_adv: %s: Forced to purge local tt entries to fit new maximum fragment MTU (%i)\n", (char *)(& _netdev->name), packet_size_max); } else { } goto ldv_51319; ldv_51316: ; if ((int )reduced) { batadv_tt_local_commit_changes_nolock(bat_priv); } else { } spin_unlock_bh(& bat_priv->tt.commit_lock); return; } } static void batadv_tt_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t flags , void *tvlv_value , uint16_t tvlv_value_len ) { struct batadv_tvlv_tt_vlan_data *tt_vlan ; struct batadv_tvlv_tt_change *tt_change ; struct batadv_tvlv_tt_data *tt_data ; uint16_t num_entries ; uint16_t num_vlan ; __u16 tmp ; { if ((unsigned int )tvlv_value_len <= 3U) { return; } else { } tt_data = (struct batadv_tvlv_tt_data *)tvlv_value; tvlv_value_len = (unsigned int )tvlv_value_len - 4U; tmp = __fswab16((int )tt_data->num_vlan); num_vlan = tmp; if ((unsigned long )tvlv_value_len < (unsigned long )num_vlan * 8UL) { return; } else { } tt_vlan = (struct batadv_tvlv_tt_vlan_data *)tt_data + 1U; tt_change = (struct batadv_tvlv_tt_change *)tt_vlan + (unsigned long )num_vlan; tvlv_value_len = (unsigned int )tvlv_value_len - (unsigned int )num_vlan * 8U; num_entries = batadv_tt_entries((int )tvlv_value_len); batadv_tt_update_orig(bat_priv, orig, (void const *)tt_vlan, (int )num_vlan, tt_change, (int )num_entries, (int )tt_data->ttvn); return; } } static int batadv_tt_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv , uint8_t *src , uint8_t *dst , void *tvlv_value , uint16_t tvlv_value_len ) { struct batadv_tvlv_tt_data *tt_data ; uint16_t tt_vlan_len ; uint16_t tt_num_entries ; char tt_flag ; bool ret ; __u16 tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { if ((unsigned int )tvlv_value_len <= 3U) { return (0); } else { } tt_data = (struct batadv_tvlv_tt_data *)tvlv_value; tvlv_value_len = (unsigned int )tvlv_value_len - 4U; tt_vlan_len = 8U; tmp = __fswab16((int )tt_data->num_vlan); tt_vlan_len = (int )tmp * (int )tt_vlan_len; if ((int )tvlv_value_len < (int )tt_vlan_len) { return (0); } else { } tvlv_value_len = (int )tvlv_value_len - (int )tt_vlan_len; tt_num_entries = batadv_tt_entries((int )tvlv_value_len); switch ((int )tt_data->flags & 15) { case 2: batadv_add_counter___0(bat_priv, 18UL, 1UL); ret = batadv_send_tt_response(bat_priv, tt_data, src, dst); if (! ret) { if (((int )tt_data->flags & 16) != 0) { tt_flag = 70; } else { tt_flag = 46; } tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 4) != 0) { batadv_debug_log(bat_priv, "Routing TT_REQUEST to %pM [%c]\n", dst, (int )tt_flag); } else { } return (1); } else { } goto ldv_51345; case 4: batadv_add_counter___0(bat_priv, 20UL, 1UL); tmp___1 = batadv_is_my_mac(bat_priv, (uint8_t const *)dst); if (tmp___1 != 0) { batadv_handle_tt_response(bat_priv, tt_data, src, (int )tt_num_entries); return (0); } else { } if (((int )tt_data->flags & 16) != 0) { tt_flag = 70; } else { tt_flag = 46; } tmp___2 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___2 & 4) != 0) { batadv_debug_log(bat_priv, "Routing TT_RESPONSE to %pM [%c]\n", dst, (int )tt_flag); } else { } return (1); } ldv_51345: ; return (0); } } static int batadv_roam_tvlv_unicast_handler_v1(struct batadv_priv *bat_priv , uint8_t *src , uint8_t *dst , void *tvlv_value , uint16_t tvlv_value_len ) { struct batadv_tvlv_roam_adv *roaming_adv ; struct batadv_orig_node *orig_node ; int tmp ; int tmp___0 ; int tmp___1 ; __u16 tmp___2 ; { orig_node = (struct batadv_orig_node *)0; tmp = batadv_is_my_mac(bat_priv, (uint8_t const *)dst); if (tmp == 0) { return (1); } else { } if ((unsigned int )tvlv_value_len <= 7U) { goto out; } else { } orig_node = batadv_orig_hash_find___6(bat_priv, (void const *)src); if ((unsigned long )orig_node == (unsigned long )((struct batadv_orig_node *)0)) { goto out; } else { } batadv_add_counter___0(bat_priv, 22UL, 1UL); roaming_adv = (struct batadv_tvlv_roam_adv *)tvlv_value; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->log_level)); if ((tmp___0 & 4) != 0) { batadv_debug_log(bat_priv, "Received ROAMING_ADV from %pM (client %pM)\n", src, (uint8_t *)(& roaming_adv->client)); } else { } tmp___1 = atomic_read((atomic_t const *)(& orig_node->last_ttvn)); tmp___2 = __fswab16((int )roaming_adv->vid); batadv_tt_global_add(bat_priv, orig_node, (unsigned char const *)(& roaming_adv->client), (int )tmp___2, 2, (int )((unsigned int )((uint8_t )tmp___1) + 1U)); out: ; if ((unsigned long )orig_node != (unsigned long )((struct batadv_orig_node *)0)) { batadv_orig_node_free_ref(orig_node); } else { } return (0); } } int batadv_tt_init(struct batadv_priv *bat_priv ) { int ret ; struct lock_class_key __key ; atomic_long_t __constr_expr_0 ; struct lock_class_key __key___0 ; unsigned long tmp ; { ret = batadv_tt_local_init(bat_priv); if (ret < 0) { return (ret); } else { } ret = batadv_tt_global_init(bat_priv); if (ret < 0) { return (ret); } else { } batadv_tvlv_handler_register(bat_priv, & batadv_tt_tvlv_ogm_handler_v1, & batadv_tt_tvlv_unicast_handler_v1, 4, 1, 0); batadv_tvlv_handler_register(bat_priv, (void (*)(struct batadv_priv * , struct batadv_orig_node * , uint8_t , void * , uint16_t ))0, & batadv_roam_tvlv_unicast_handler_v1, 5, 1, 0); __init_work(& bat_priv->tt.work.work, 0); __constr_expr_0.counter = 137438953408L; bat_priv->tt.work.work.data = __constr_expr_0; lockdep_init_map(& bat_priv->tt.work.work.lockdep_map, "(&(&bat_priv->tt.work)->work)", & __key, 0); INIT_LIST_HEAD(& bat_priv->tt.work.work.entry); bat_priv->tt.work.work.func = & batadv_tt_purge; init_timer_key(& bat_priv->tt.work.timer, 2U, "(&(&bat_priv->tt.work)->timer)", & __key___0); bat_priv->tt.work.timer.function = & delayed_work_timer_fn; bat_priv->tt.work.timer.data = (unsigned long )(& bat_priv->tt.work); tmp = msecs_to_jiffies(5000U); queue_delayed_work(batadv_event_workqueue, & bat_priv->tt.work, tmp); return (1); } } bool batadv_tt_global_is_isolated(struct batadv_priv *bat_priv , uint8_t const *addr , unsigned short vid ) { struct batadv_tt_global_entry *tt ; bool ret ; { tt = batadv_tt_global_hash_find(bat_priv, addr, (int )vid); if ((unsigned long )tt == (unsigned long )((struct batadv_tt_global_entry *)0)) { return (0); } else { } ret = ((int )tt->common.flags & 32) != 0; batadv_tt_global_entry_free_ref(tt); return (ret); } } void *ldv_kmem_cache_alloc_822(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_828(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_830(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_832(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_833(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_834(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_835(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_836(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_837(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_838(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_839(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void spin_lock_bh(spinlock_t *lock ) ; __inline static void spin_unlock_bh(spinlock_t *lock ) ; void *ldv_kmem_cache_alloc_866(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; void *ldv_kmem_cache_alloc_883(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_874(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_clone_882(struct sk_buff *ldv_func_arg1 , gfp_t flags ) ; struct sk_buff *ldv_skb_copy_876(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) ; int ldv_pskb_expand_head_872(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_880(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; int ldv_pskb_expand_head_881(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_877(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_878(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; struct sk_buff *ldv___netdev_alloc_skb_879(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) ; __inline static bool ipv4_is_local_multicast(__be32 addr ) { { return ((addr & 16777215U) == 224U); } } __inline static void netif_addr_lock_bh(struct net_device *dev ) { { spin_lock_bh(& dev->addr_list_lock); return; } } __inline static void netif_addr_unlock_bh(struct net_device *dev ) { { spin_unlock_bh(& dev->addr_list_lock); return; } } extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device * ) ; __inline static struct ipv6hdr *ipv6_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_network_header(skb); return ((struct ipv6hdr *)tmp); } } __inline static bool ipv6_addr_is_ll_all_nodes(struct in6_addr const *addr ) { __be64 *p ; { p = (__be64 *)addr; return (((*p ^ 767ULL) | (*(p + 1UL) ^ 72057594037927936ULL)) == 0ULL); } } __inline static struct iphdr *ip_hdr(struct sk_buff const *skb ) { unsigned char *tmp ; { tmp = skb_network_header(skb); return ((struct iphdr *)tmp); } } static int batadv_mcast_mla_softif_get(struct net_device *dev , struct hlist_head *mcast_list ) { struct netdev_hw_addr *mc_list_entry ; struct batadv_hw_addr *new ; int ret ; struct list_head const *__mptr ; void *tmp ; struct list_head const *__mptr___0 ; { ret = 0; netif_addr_lock_bh(dev); __mptr = (struct list_head const *)dev->mc.list.next; mc_list_entry = (struct netdev_hw_addr *)__mptr; goto ldv_49686; ldv_49685: tmp = kmalloc(24UL, 32U); new = (struct batadv_hw_addr *)tmp; if ((unsigned long )new == (unsigned long )((struct batadv_hw_addr *)0)) { ret = -12; goto ldv_49684; } else { } ether_addr_copy((u8 *)(& new->addr), (u8 const *)(& mc_list_entry->addr)); hlist_add_head(& new->list, mcast_list); ret = ret + 1; __mptr___0 = (struct list_head const *)mc_list_entry->list.next; mc_list_entry = (struct netdev_hw_addr *)__mptr___0; ldv_49686: ; if ((unsigned long )(& mc_list_entry->list) != (unsigned long )(& dev->mc.list)) { goto ldv_49685; } else { } ldv_49684: netif_addr_unlock_bh(dev); return (ret); } } static bool batadv_mcast_mla_is_duplicate(uint8_t *mcast_addr , struct hlist_head *mcast_list ) { struct batadv_hw_addr *mcast_entry ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_hw_addr *tmp ; int tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_hw_addr *tmp___1 ; { ____ptr = mcast_list->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp = (struct batadv_hw_addr *)__mptr; } else { tmp = (struct batadv_hw_addr *)0; } mcast_entry = tmp; goto ldv_49701; ldv_49700: tmp___0 = batadv_compare_eth((void const *)(& mcast_entry->addr), (void const *)mcast_addr); if (tmp___0 != 0) { return (1); } else { } ____ptr___0 = mcast_entry->list.next; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_hw_addr *)__mptr___0; } else { tmp___1 = (struct batadv_hw_addr *)0; } mcast_entry = tmp___1; ldv_49701: ; if ((unsigned long )mcast_entry != (unsigned long )((struct batadv_hw_addr *)0)) { goto ldv_49700; } else { } return (0); } } static void batadv_mcast_mla_list_free(struct hlist_head *mcast_list ) { struct batadv_hw_addr *mcast_entry ; struct hlist_node *tmp ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_hw_addr *tmp___0 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_hw_addr *tmp___1 ; { ____ptr = mcast_list->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_hw_addr *)__mptr; } else { tmp___0 = (struct batadv_hw_addr *)0; } mcast_entry = tmp___0; goto ldv_49718; ldv_49717: hlist_del(& mcast_entry->list); kfree((void const *)mcast_entry); ____ptr___0 = tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___1 = (struct batadv_hw_addr *)__mptr___0; } else { tmp___1 = (struct batadv_hw_addr *)0; } mcast_entry = tmp___1; ldv_49718: ; if ((unsigned long )mcast_entry != (unsigned long )((struct batadv_hw_addr *)0)) { tmp = mcast_entry->list.next; goto ldv_49717; } else { } return; } } static void batadv_mcast_mla_tt_retract(struct batadv_priv *bat_priv , struct hlist_head *mcast_list ) { struct batadv_hw_addr *mcast_entry ; struct hlist_node *tmp ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_hw_addr *tmp___0 ; bool tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_hw_addr *tmp___2 ; { ____ptr = bat_priv->mcast.mla_list.first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_hw_addr *)__mptr; } else { tmp___0 = (struct batadv_hw_addr *)0; } mcast_entry = tmp___0; goto ldv_49737; ldv_49736: ; if ((unsigned long )mcast_list != (unsigned long )((struct hlist_head *)0)) { tmp___1 = batadv_mcast_mla_is_duplicate((uint8_t *)(& mcast_entry->addr), mcast_list); if ((int )tmp___1) { goto ldv_49735; } else { } } else { } batadv_tt_local_remove(bat_priv, (uint8_t const *)(& mcast_entry->addr), 0, "mcast TT outdated", 0); hlist_del(& mcast_entry->list); kfree((void const *)mcast_entry); ldv_49735: ____ptr___0 = tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___2 = (struct batadv_hw_addr *)__mptr___0; } else { tmp___2 = (struct batadv_hw_addr *)0; } mcast_entry = tmp___2; ldv_49737: ; if ((unsigned long )mcast_entry != (unsigned long )((struct batadv_hw_addr *)0)) { tmp = mcast_entry->list.next; goto ldv_49736; } else { } return; } } static void batadv_mcast_mla_tt_add(struct batadv_priv *bat_priv , struct hlist_head *mcast_list ) { struct batadv_hw_addr *mcast_entry ; struct hlist_node *tmp ; struct hlist_node *____ptr ; struct hlist_node const *__mptr ; struct batadv_hw_addr *tmp___0 ; bool tmp___1 ; bool tmp___2 ; int tmp___3 ; struct hlist_node *____ptr___0 ; struct hlist_node const *__mptr___0 ; struct batadv_hw_addr *tmp___4 ; { if ((unsigned long )mcast_list == (unsigned long )((struct hlist_head *)0)) { return; } else { } ____ptr = mcast_list->first; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_hw_addr *)__mptr; } else { tmp___0 = (struct batadv_hw_addr *)0; } mcast_entry = tmp___0; goto ldv_49756; ldv_49755: tmp___1 = batadv_mcast_mla_is_duplicate((uint8_t *)(& mcast_entry->addr), & bat_priv->mcast.mla_list); if ((int )tmp___1) { goto ldv_49754; } else { } tmp___2 = batadv_tt_local_add(bat_priv->soft_iface, (uint8_t const *)(& mcast_entry->addr), 0, 0, 0U); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { goto ldv_49754; } else { } hlist_del(& mcast_entry->list); hlist_add_head(& mcast_entry->list, & bat_priv->mcast.mla_list); ldv_49754: ____ptr___0 = tmp; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___4 = (struct batadv_hw_addr *)__mptr___0; } else { tmp___4 = (struct batadv_hw_addr *)0; } mcast_entry = tmp___4; ldv_49756: ; if ((unsigned long )mcast_entry != (unsigned long )((struct batadv_hw_addr *)0)) { tmp = mcast_entry->list.next; goto ldv_49755; } else { } return; } } static bool batadv_mcast_has_bridge(struct batadv_priv *bat_priv ) { struct net_device *upper ; { upper = bat_priv->soft_iface; rcu_read_lock(); ldv_49762: upper = netdev_master_upper_dev_get_rcu(upper); if ((unsigned long )upper != (unsigned long )((struct net_device *)0) && (upper->priv_flags & 2U) == 0U) { goto ldv_49762; } else { } rcu_read_unlock(); return ((unsigned long )upper != (unsigned long )((struct net_device *)0)); } } static bool batadv_mcast_mla_tvlv_update(struct batadv_priv *bat_priv ) { struct batadv_tvlv_mcast_data mcast_data ; bool tmp ; { mcast_data.flags = 0U; memset((void *)(& mcast_data.reserved), 0, 3UL); tmp = batadv_mcast_has_bridge(bat_priv); if ((int )tmp) { if ((int )bat_priv->mcast.enabled) { batadv_tvlv_container_unregister(bat_priv, 6, 1); bat_priv->mcast.enabled = 0; } else { } return (0); } else { } if (! bat_priv->mcast.enabled || (int )mcast_data.flags != (int )bat_priv->mcast.flags) { batadv_tvlv_container_register(bat_priv, 6, 1, (void *)(& mcast_data), 4); bat_priv->mcast.flags = mcast_data.flags; bat_priv->mcast.enabled = 1; } else { } return (1); } } void batadv_mcast_mla_update(struct batadv_priv *bat_priv ) { struct net_device *soft_iface ; struct hlist_head mcast_list ; int ret ; bool tmp ; int tmp___0 ; { soft_iface = bat_priv->soft_iface; mcast_list.first = (struct hlist_node *)0; tmp = batadv_mcast_mla_tvlv_update(bat_priv); if (tmp) { tmp___0 = 0; } else { tmp___0 = 1; } if (tmp___0) { goto update; } else { } ret = batadv_mcast_mla_softif_get(soft_iface, & mcast_list); if (ret < 0) { goto out; } else { } update: batadv_mcast_mla_tt_retract(bat_priv, & mcast_list); batadv_mcast_mla_tt_add(bat_priv, & mcast_list); out: batadv_mcast_mla_list_free(& mcast_list); return; } } static int batadv_mcast_forw_mode_check_ipv4(struct batadv_priv *bat_priv , struct sk_buff *skb , bool *is_unsnoopable ) { struct iphdr *iphdr ; int tmp ; bool tmp___0 ; int tmp___1 ; { tmp = pskb_may_pull(skb, 34U); if (tmp == 0) { return (-12); } else { } iphdr = ip_hdr((struct sk_buff const *)skb); tmp___0 = ipv4_is_local_multicast(iphdr->daddr); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { return (-22); } else { } *is_unsnoopable = 1; return (0); } } static int batadv_mcast_forw_mode_check_ipv6(struct batadv_priv *bat_priv , struct sk_buff *skb , bool *is_unsnoopable ) { struct ipv6hdr *ip6hdr ; int tmp ; bool tmp___0 ; { tmp = pskb_may_pull(skb, 54U); if (tmp == 0) { return (-12); } else { } ip6hdr = ipv6_hdr((struct sk_buff const *)skb); if (((int )ip6hdr->daddr.in6_u.u6_addr8[1] & 15) != 2) { return (-22); } else { } tmp___0 = ipv6_addr_is_ll_all_nodes((struct in6_addr const *)(& ip6hdr->daddr)); if ((int )tmp___0) { *is_unsnoopable = 1; } else { } return (0); } } static int batadv_mcast_forw_mode_check(struct batadv_priv *bat_priv , struct sk_buff *skb , bool *is_unsnoopable ) { struct ethhdr *ethhdr ; struct ethhdr *tmp ; int tmp___0 ; int tmp___1 ; __u16 tmp___2 ; int tmp___3 ; int tmp___4 ; { tmp = eth_hdr((struct sk_buff const *)skb); ethhdr = tmp; tmp___0 = atomic_read((atomic_t const *)(& bat_priv->multicast_mode)); if (tmp___0 == 0) { return (-22); } else { } tmp___1 = atomic_read((atomic_t const *)(& bat_priv->mcast.num_disabled)); if (tmp___1 != 0) { return (-22); } else { } tmp___2 = __fswab16((int )ethhdr->h_proto); switch ((int )tmp___2) { case 2048: tmp___3 = batadv_mcast_forw_mode_check_ipv4(bat_priv, skb, is_unsnoopable); return (tmp___3); case 34525: tmp___4 = batadv_mcast_forw_mode_check_ipv6(bat_priv, skb, is_unsnoopable); return (tmp___4); default: ; return (-22); } } } static int batadv_mcast_forw_want_all_ip_count(struct batadv_priv *bat_priv , struct ethhdr *ethhdr ) { __u16 tmp ; int tmp___0 ; int tmp___1 ; { tmp = __fswab16((int )ethhdr->h_proto); switch ((int )tmp) { case 2048: tmp___0 = atomic_read((atomic_t const *)(& bat_priv->mcast.num_want_all_ipv4)); return (tmp___0); case 34525: tmp___1 = atomic_read((atomic_t const *)(& bat_priv->mcast.num_want_all_ipv6)); return (tmp___1); default: ; return (0); } } } static struct batadv_orig_node *batadv_mcast_forw_tt_node_get(struct batadv_priv *bat_priv , struct ethhdr *ethhdr ) { struct batadv_orig_node *tmp ; { tmp = batadv_transtable_search(bat_priv, (uint8_t const *)(& ethhdr->h_source), (uint8_t const *)(& ethhdr->h_dest), 0); return (tmp); } } static struct batadv_orig_node *batadv_mcast_forw_ipv4_node_get(struct batadv_priv *bat_priv ) { struct batadv_orig_node *tmp_orig_node ; struct batadv_orig_node *orig_node ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___3 ; { orig_node = (struct batadv_orig_node *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->mcast.want_all_ipv4_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_orig_node *)__mptr + 0xffffffffffffffb0UL; } else { tmp___0 = (struct batadv_orig_node *)0; } tmp_orig_node = tmp___0; goto ldv_49836; ldv_49835: tmp___1 = atomic_add_unless(& tmp_orig_node->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_49833; } else { } orig_node = tmp_orig_node; goto ldv_49834; ldv_49833: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_orig_node->mcast_want_all_ipv4_node.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_orig_node *)__mptr___0 + 0xffffffffffffffb0UL; } else { tmp___3 = (struct batadv_orig_node *)0; } tmp_orig_node = tmp___3; ldv_49836: ; if ((unsigned long )tmp_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49835; } else { } ldv_49834: rcu_read_unlock(); return (orig_node); } } static struct batadv_orig_node *batadv_mcast_forw_ipv6_node_get(struct batadv_priv *bat_priv ) { struct batadv_orig_node *tmp_orig_node ; struct batadv_orig_node *orig_node ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___3 ; { orig_node = (struct batadv_orig_node *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->mcast.want_all_ipv6_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_orig_node *)__mptr + 0xffffffffffffffa0UL; } else { tmp___0 = (struct batadv_orig_node *)0; } tmp_orig_node = tmp___0; goto ldv_49865; ldv_49864: tmp___1 = atomic_add_unless(& tmp_orig_node->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_49862; } else { } orig_node = tmp_orig_node; goto ldv_49863; ldv_49862: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_orig_node->mcast_want_all_ipv6_node.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_orig_node *)__mptr___0 + 0xffffffffffffffa0UL; } else { tmp___3 = (struct batadv_orig_node *)0; } tmp_orig_node = tmp___3; ldv_49865: ; if ((unsigned long )tmp_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49864; } else { } ldv_49863: rcu_read_unlock(); return (orig_node); } } static struct batadv_orig_node *batadv_mcast_forw_ip_node_get(struct batadv_priv *bat_priv , struct ethhdr *ethhdr ) { __u16 tmp ; struct batadv_orig_node *tmp___0 ; struct batadv_orig_node *tmp___1 ; { tmp = __fswab16((int )ethhdr->h_proto); switch ((int )tmp) { case 2048: tmp___0 = batadv_mcast_forw_ipv4_node_get(bat_priv); return (tmp___0); case 34525: tmp___1 = batadv_mcast_forw_ipv6_node_get(bat_priv); return (tmp___1); default: ; return ((struct batadv_orig_node *)0); } } } static struct batadv_orig_node *batadv_mcast_forw_unsnoop_node_get(struct batadv_priv *bat_priv ) { struct batadv_orig_node *tmp_orig_node ; struct batadv_orig_node *orig_node ; struct hlist_node *____ptr ; struct hlist_node *_________p1 ; bool __warned ; int tmp ; struct hlist_node const *__mptr ; struct batadv_orig_node *tmp___0 ; int tmp___1 ; struct hlist_node *____ptr___0 ; struct hlist_node *_________p1___0 ; bool __warned___0 ; int tmp___2 ; struct hlist_node const *__mptr___0 ; struct batadv_orig_node *tmp___3 ; { orig_node = (struct batadv_orig_node *)0; rcu_read_lock(); _________p1 = *((struct hlist_node * volatile *)(& bat_priv->mcast.want_all_unsnoopables_list.first)); tmp = debug_lockdep_rcu_enabled(); if (tmp != 0 && ! __warned) { rcu_read_lock_held(); } else { } ____ptr = _________p1; if ((unsigned long )____ptr != (unsigned long )((struct hlist_node *)0)) { __mptr = (struct hlist_node const *)____ptr; tmp___0 = (struct batadv_orig_node *)__mptr + 0xffffffffffffffc0UL; } else { tmp___0 = (struct batadv_orig_node *)0; } tmp_orig_node = tmp___0; goto ldv_49901; ldv_49900: tmp___1 = atomic_add_unless(& tmp_orig_node->refcount, 1, 0); if (tmp___1 == 0) { goto ldv_49898; } else { } orig_node = tmp_orig_node; goto ldv_49899; ldv_49898: _________p1___0 = *((struct hlist_node * volatile *)(& tmp_orig_node->mcast_want_all_unsnoopables_node.next)); tmp___2 = debug_lockdep_rcu_enabled(); if (tmp___2 != 0 && ! __warned___0) { rcu_read_lock_held(); } else { } ____ptr___0 = _________p1___0; if ((unsigned long )____ptr___0 != (unsigned long )((struct hlist_node *)0)) { __mptr___0 = (struct hlist_node const *)____ptr___0; tmp___3 = (struct batadv_orig_node *)__mptr___0 + 0xffffffffffffffc0UL; } else { tmp___3 = (struct batadv_orig_node *)0; } tmp_orig_node = tmp___3; ldv_49901: ; if ((unsigned long )tmp_orig_node != (unsigned long )((struct batadv_orig_node *)0)) { goto ldv_49900; } else { } ldv_49899: rcu_read_unlock(); return (orig_node); } } enum batadv_forw_mode batadv_mcast_forw_mode(struct batadv_priv *bat_priv , struct sk_buff *skb , struct batadv_orig_node **orig ) { int ret ; int tt_count ; int ip_count ; int unsnoop_count ; int total_count ; bool is_unsnoopable ; struct ethhdr *ethhdr ; int tmp ; { is_unsnoopable = 0; ret = batadv_mcast_forw_mode_check(bat_priv, skb, & is_unsnoopable); if (ret == -12) { return (2); } else if (ret < 0) { return (0); } else { } ethhdr = eth_hdr((struct sk_buff const *)skb); tt_count = batadv_tt_global_hash_count(bat_priv, (uint8_t const *)(& ethhdr->h_dest), 0); ip_count = batadv_mcast_forw_want_all_ip_count(bat_priv, ethhdr); if (! is_unsnoopable) { unsnoop_count = 0; } else { tmp = atomic_read((atomic_t const *)(& bat_priv->mcast.num_want_all_unsnoopables)); unsnoop_count = tmp; } total_count = (tt_count + ip_count) + unsnoop_count; switch (total_count) { case 1: ; if (tt_count != 0) { *orig = batadv_mcast_forw_tt_node_get(bat_priv, ethhdr); } else if (ip_count != 0) { *orig = batadv_mcast_forw_ip_node_get(bat_priv, ethhdr); } else if (unsnoop_count != 0) { *orig = batadv_mcast_forw_unsnoop_node_get(bat_priv); } else { } if ((unsigned long )*orig != (unsigned long )((struct batadv_orig_node *)0)) { return (1); } else { } case 0: ; return (2); default: ; return (0); } } } static void batadv_mcast_want_unsnoop_update(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t mcast_flags ) { { if ((int )mcast_flags & 1 && ((int )orig->mcast_flags & 1) == 0) { atomic_inc(& bat_priv->mcast.num_want_all_unsnoopables); spin_lock_bh(& bat_priv->mcast.want_lists_lock); hlist_add_head_rcu(& orig->mcast_want_all_unsnoopables_node, & bat_priv->mcast.want_all_unsnoopables_list); spin_unlock_bh(& bat_priv->mcast.want_lists_lock); } else if (((int )mcast_flags & 1) == 0 && (int )orig->mcast_flags & 1) { atomic_dec(& bat_priv->mcast.num_want_all_unsnoopables); spin_lock_bh(& bat_priv->mcast.want_lists_lock); hlist_del_rcu(& orig->mcast_want_all_unsnoopables_node); spin_unlock_bh(& bat_priv->mcast.want_lists_lock); } else { } return; } } static void batadv_mcast_want_ipv4_update(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t mcast_flags ) { { if (((int )mcast_flags & 2) != 0 && ((int )orig->mcast_flags & 2) == 0) { atomic_inc(& bat_priv->mcast.num_want_all_ipv4); spin_lock_bh(& bat_priv->mcast.want_lists_lock); hlist_add_head_rcu(& orig->mcast_want_all_ipv4_node, & bat_priv->mcast.want_all_ipv4_list); spin_unlock_bh(& bat_priv->mcast.want_lists_lock); } else if (((int )mcast_flags & 2) == 0 && ((int )orig->mcast_flags & 2) != 0) { atomic_dec(& bat_priv->mcast.num_want_all_ipv4); spin_lock_bh(& bat_priv->mcast.want_lists_lock); hlist_del_rcu(& orig->mcast_want_all_ipv4_node); spin_unlock_bh(& bat_priv->mcast.want_lists_lock); } else { } return; } } static void batadv_mcast_want_ipv6_update(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t mcast_flags ) { { if (((int )mcast_flags & 4) != 0 && ((int )orig->mcast_flags & 4) == 0) { atomic_inc(& bat_priv->mcast.num_want_all_ipv6); spin_lock_bh(& bat_priv->mcast.want_lists_lock); hlist_add_head_rcu(& orig->mcast_want_all_ipv6_node, & bat_priv->mcast.want_all_ipv6_list); spin_unlock_bh(& bat_priv->mcast.want_lists_lock); } else if (((int )mcast_flags & 4) == 0 && ((int )orig->mcast_flags & 4) != 0) { atomic_dec(& bat_priv->mcast.num_want_all_ipv6); spin_lock_bh(& bat_priv->mcast.want_lists_lock); hlist_del_rcu(& orig->mcast_want_all_ipv6_node); spin_unlock_bh(& bat_priv->mcast.want_lists_lock); } else { } return; } } static void batadv_mcast_tvlv_ogm_handler_v1(struct batadv_priv *bat_priv , struct batadv_orig_node *orig , uint8_t flags , void *tvlv_value , uint16_t tvlv_value_len ) { bool orig_mcast_enabled ; uint8_t mcast_flags ; bool orig_initialized ; { orig_mcast_enabled = ((int )flags & 2) == 0; mcast_flags = 0U; orig_initialized = ((int )orig->capa_initialized & 8) != 0; if ((int )orig_mcast_enabled && ((int )orig->capabilities & 8) == 0) { if ((int )orig_initialized) { atomic_dec(& bat_priv->mcast.num_disabled); } else { } orig->capabilities = (uint8_t )((unsigned int )orig->capabilities | 8U); } else if (! orig_mcast_enabled && ((int )orig->capabilities & 8) != 0) { atomic_inc(& bat_priv->mcast.num_disabled); orig->capabilities = (unsigned int )orig->capabilities & 247U; } else { } orig->capa_initialized = (uint8_t )((unsigned int )orig->capa_initialized | 8U); if (((int )orig_mcast_enabled && (unsigned long )tvlv_value != (unsigned long )((void *)0)) && (unsigned int )tvlv_value_len != 0U) { mcast_flags = *((uint8_t *)tvlv_value); } else { } batadv_mcast_want_unsnoop_update(bat_priv, orig, (int )mcast_flags); batadv_mcast_want_ipv4_update(bat_priv, orig, (int )mcast_flags); batadv_mcast_want_ipv6_update(bat_priv, orig, (int )mcast_flags); orig->mcast_flags = mcast_flags; return; } } void batadv_mcast_init(struct batadv_priv *bat_priv ) { { batadv_tvlv_handler_register(bat_priv, & batadv_mcast_tvlv_ogm_handler_v1, (int (*)(struct batadv_priv * , uint8_t * , uint8_t * , void * , uint16_t ))0, 6, 1, 2); return; } } void batadv_mcast_free(struct batadv_priv *bat_priv ) { { batadv_tvlv_container_unregister(bat_priv, 6, 1); batadv_tvlv_handler_unregister(bat_priv, 6, 1); batadv_mcast_mla_tt_retract(bat_priv, (struct hlist_head *)0); return; } } void batadv_mcast_purge_orig(struct batadv_orig_node *orig ) { struct batadv_priv *bat_priv ; { bat_priv = orig->bat_priv; if (((int )orig->capabilities & 8) == 0) { atomic_dec(& bat_priv->mcast.num_disabled); } else { } batadv_mcast_want_unsnoop_update(bat_priv, orig, 0); batadv_mcast_want_ipv4_update(bat_priv, orig, 0); batadv_mcast_want_ipv6_update(bat_priv, orig, 0); return; } } void *ldv_kmem_cache_alloc_866(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } int ldv_pskb_expand_head_872(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_874(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv_skb_copy_876(struct sk_buff const *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_copy(ldv_func_arg1, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_877(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_878(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } struct sk_buff *ldv___netdev_alloc_skb_879(struct net_device *ldv_func_arg1 , unsigned int ldv_func_arg2 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = __netdev_alloc_skb(ldv_func_arg1, ldv_func_arg2, flags); return (tmp); } } int ldv_pskb_expand_head_880(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } int ldv_pskb_expand_head_881(struct sk_buff *ldv_func_arg1 , int ldv_func_arg2 , int ldv_func_arg3 , gfp_t flags ) { int tmp ; { ldv_check_alloc_flags(flags); tmp = pskb_expand_head(ldv_func_arg1, ldv_func_arg2, ldv_func_arg3, flags); return (tmp); } } struct sk_buff *ldv_skb_clone_882(struct sk_buff *ldv_func_arg1 , gfp_t flags ) { struct sk_buff *tmp ; { ldv_check_alloc_flags(flags); tmp = skb_clone(ldv_func_arg1, flags); return (tmp); } } void *ldv_kmem_cache_alloc_883(struct kmem_cache *ldv_func_arg1 , gfp_t flags ) { { ldv_check_alloc_flags(flags); kmem_cache_alloc(ldv_func_arg1, flags); return ((void *)0); } } __inline static void ldv_error(void); int ldv_spin = 0; void ldv_check_alloc_flags(gfp_t flags ) { { if (ldv_spin == 0 || ! (flags & 16U)) { } else { ldv_error(); } return; } } extern struct page___0 *ldv_some_page(void) ; struct page___0 *ldv_check_alloc_flags_and_return_some_page(gfp_t flags ) { struct page___0 *tmp ; { if (ldv_spin == 0 || ! (flags & 16U)) { } else { ldv_error(); } tmp = ldv_some_page(); return (tmp); } } void ldv_check_alloc_nonatomic(void) { { if (ldv_spin == 0) { } else { ldv_error(); } return; } } void ldv_spin_lock(void) { { ldv_spin = 1; return; } } void ldv_spin_unlock(void) { { ldv_spin = 0; return; } } int ldv_spin_trylock(void) { int is_lock ; { is_lock = ldv_undef_int(); if (is_lock) { return (0); } else { ldv_spin = 1; return (1); } } }