link: Support unsetting master. * ip/link.scm (link-set): Add #:nomaster argument. * doc/guile-netlink.texi: Document it.
doc/guile-netlink.texi
| 212 | 212 | [#:promisc-on @code{#f}] [#:promisc-off @code{#f}] [#:trailers-on @code{#f}] @ | |
| 213 | 213 | [#:trailers-off @code{#f}] [#:carrier-on @code{#f}] [#:carrier-off @code{#f}] @ | |
| 214 | 214 | [#:txqueuelen @code{#f}] [#:name @code{#f}] [#:address @code{#f}] @ | |
| 215 | - | [#:broadcast @code{#f}] [#:mtu @code{#f}] [#:netns @code{#f}] | |
| 215 | + | [#:broadcast @code{#f}] [#:mtu @code{#f}] [#:netns @code{#f}] @ | |
| 216 | + | [#:master @code{#f}] [#:nomaster @code{#f}] | |
| 216 | 217 | Modify an existing link and set its flags and attributes to the ones specified | |
| 217 | 218 | by the various keywords. When a keyword is omited, the corresponding attribute | |
| 218 | 219 | is not changed. | |
… | |||
| 220 | 221 | @var{device} can be a device index (as a number) or a device name (as a string). | |
| 221 | 222 | ||
| 222 | 223 | Do not set @code{#:up} and @code{#:down} at the same time. Do not set | |
| 223 | - | @code{*-on} and @code{*-off} at the same time. | |
| 224 | + | @code{*-on} and @code{*-off} at the same time. Do not set @code{#:master} | |
| 225 | + | and @code{#:nomaster} at the same time (the latter is ignored). | |
| 224 | 226 | @end deffn | |
| 225 | 227 | ||
| 226 | 228 | @deffn {Scheme Procedure} link-show [#:device @code{#f}] [#:group @code{#f}] @ | |
ip/link.scm
| 177 | 177 | (carrier-on #f) (carrier-off #f) | |
| 178 | 178 | (txqueuelen #f) (name #f) (address #f) | |
| 179 | 179 | (broadcast #f) (mtu #f) (netns #f) | |
| 180 | - | (master #f)) | |
| 180 | + | (master #f) (nomaster #f)) | |
| 181 | 181 | (define request-num (random 65535)) | |
| 182 | 182 | (define id (if (number? device) device (link-name->index device))) | |
| 183 | 183 | (define netnsfd (cond | |
… | |||
| 242 | 242 | (make-route-attr IFLA_MTU | |
| 243 | 243 | (make-u32-route-attr mtu))) | |
| 244 | 244 | '()) | |
| 245 | - | ,@(if master | |
| 245 | + | ,@(if (or master nomaster) | |
| 246 | 246 | (list | |
| 247 | 247 | (make-route-attr IFLA_MASTER | |
| 248 | - | (make-u32-route-attr (link-name->index master)))) | |
| 248 | + | (make-u32-route-attr | |
| 249 | + | (if master (link-name->index master) 0)))) | |
| 249 | 250 | '()) | |
| 250 | 251 | ,@(if netns | |
| 251 | 252 | (list | |