28 May, 2017

1 commit

  • Whenever a user changes bonding options, a NETDEV_CHANGEINFODATA
    notificatin is generated which results in a rtnelink message to
    be sent. While runnig 'ip monitor', we can actually see 2 messages,
    one a result of the event, and the other a result of state change
    that is generated bo netdev_state_change(). However, this is not
    always the case. If bonding changes were done via sysfs or ifenslave
    (old ioctl interface), then only 1 message is seen.

    This patch removes duplicate messages in the case of using netlink
    to configure bonding. It introduceds a separte function that
    triggers a netdev event and uses that function in the syfs and ioctl
    cases.

    This was discovered while auditing all the different envents and
    continues the effort of cleaning up duplicated netlink messages.

    CC: David Ahern
    CC: Jiri Pirko
    Signed-off-by: Vladislav Yasevich
    Acked-by: David Ahern
    Signed-off-by: David S. Miller

    Vlad Yasevich
     

27 Jul, 2015

1 commit

  • num_grat_arp wasn't converted to the new bonding option API, so do this
    now and remove the specific sysfs store option in order to use the
    standard one. num_grat_arp is the same as num_unsol_na so add it as an
    alias with the same option settings. An important difference is the option
    name which is matched in bond_sysfs_store_option().

    Signed-off-by: Nikolay Aleksandrov
    Acked-by: Veaceslav Falico
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

11 May, 2015

3 commits

  • The port key has three components - user-key, speed-part, and duplex-part.
    The LSBit is for the duplex-part, next 5 bits are for the speed while the
    remaining 10 bits are the user defined key bits. Get these 10 bits
    from the user-space (through the SysFs interface) and use it to form the
    admin port-key. Allowed range for the user-key is 0 - 1023 (10 bits). If
    it is not provided then use zero for the user-key-bits (default).

    It can set using following example code -

    # modprobe bonding mode=4
    # usr_port_key=$(( RANDOM & 0x3FF ))
    # echo $usr_port_key > /sys/class/net/bond0/bonding/ad_user_port_key
    # echo +eth1 > /sys/class/net/bond0/bonding/slaves
    ...
    # ip link set bond0 up

    Signed-off-by: Mahesh Bandewar
    Reviewed-by: Nikolay Aleksandrov
    [jt: * fixed up style issues reported by checkpatch
    * fixed up context from change in ad_actor_sys_prio patch]
    Signed-off-by: Jonathan Toppins
    Signed-off-by: David S. Miller

    Mahesh Bandewar
     
  • In an AD system, the communication between actor and partner is the
    business between these two entities. In the current setup anyone on the
    same L2 can "guess" the LACPDU contents and then possibly send the
    spoofed LACPDUs and trick the partner causing connectivity issues for
    the AD system. This patch allows to use a random mac-address obscuring
    it's identity making it harder for someone in the L2 is do the same thing.

    This patch allows user-space to choose the mac-address for the AD-system.
    This mac-address can not be NULL or a Multicast. If the mac-address is set
    from user-space; kernel will honor it and will not overwrite it. In the
    absence (value from user space); the logic will default to using the
    masters' mac as the mac-address for the AD-system.

    It can be set using example code below -

    # modprobe bonding mode=4
    # sys_mac_addr=$(printf '%02x:%02x:%02x:%02x:%02x:%02x' \
    $(( (RANDOM & 0xFE) | 0x02 )) \
    $(( RANDOM & 0xFF )) \
    $(( RANDOM & 0xFF )) \
    $(( RANDOM & 0xFF )) \
    $(( RANDOM & 0xFF )) \
    $(( RANDOM & 0xFF )))
    # echo $sys_mac_addr > /sys/class/net/bond0/bonding/ad_actor_system
    # echo +eth1 > /sys/class/net/bond0/bonding/slaves
    ...
    # ip link set bond0 up

    Signed-off-by: Mahesh Bandewar
    Reviewed-by: Nikolay Aleksandrov
    [jt: fixed up style issues reported by checkpatch]
    Signed-off-by: Jonathan Toppins
    Signed-off-by: David S. Miller

    Mahesh Bandewar
     
  • This patch allows user to randomize the system-priority in an ad-system.
    The allowed range is 1 - 0xFFFF while default value is 0xFFFF. If user
    does not specify this value, the system defaults to 0xFFFF, which is
    what it was before this patch.

    Following example code could set the value -
    # modprobe bonding mode=4
    # sys_prio=$(( 1 + RANDOM + RANDOM ))
    # echo $sys_prio > /sys/class/net/bond0/bonding/ad_actor_sys_prio
    # echo +eth1 > /sys/class/net/bond0/bonding/slaves
    ...
    # ip link set bond0 up

    Signed-off-by: Mahesh Bandewar
    Reviewed-by: Nikolay Aleksandrov
    [jt: * fixed up style issues reported by checkpatch
    * changed how the default value is set in bond_check_params(), this
    makes the default consistent between what gets set for a new bond
    and what the default is claimed to be in the bonding options.]
    Signed-off-by: Jonathan Toppins
    Signed-off-by: David S. Miller

    Mahesh Bandewar
     

11 Nov, 2014

1 commit