link: Allow to bind interfaces to bonds.

Alexey AbramovSun Oct 09 15:42:58+0200 2022

a38409b

link: Allow to bind interfaces to bonds. * ip/link.scm (link-set): Add new argument `master'. It should be the name of the master interface to which our current device has to be bound. Signed-off-by: Julien Lepiller <julien@lepiller.eu>

ip/link.scm

164164
                   (trailers-on #f) (trailers-off #f)
165165
                   (carrier-on #f) (carrier-off #f)
166166
                   (txqueuelen #f) (name #f) (address #f)
167-
                   (broadcast #f) (mtu #f) (netns #f))
167+
                   (broadcast #f) (mtu #f) (netns #f)
168+
                   (master #f))
168169
  (define request-num (random 65535))
169170
  (define id (if (number? device) device (link-name->index device)))
170171
  (define netnsfd (cond

229230
                  (make-route-attr IFLA_MTU
230231
                    (make-u32-route-attr mtu)))
231232
                '())
233+
          ,@(if master
234+
                (list
235+
                  (make-route-attr IFLA_MASTER
236+
                    (make-u32-route-attr (link-name->index master))))
237+
                '())
232238
          ,@(if netns
233239
                (list
234240
                  (make-route-attr IFLA_NET_NS_FD