Bug 238580 - ifconfig(8): respect defines from 'sys/netinet/ip_carp.h'
Summary: ifconfig(8): respect defines from 'sys/netinet/ip_carp.h'
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL: https://reviews.freebsd.org/D20638
Keywords: patch, standards
Depends on:
Blocks:
 
Reported: 2019-06-15 14:55 UTC by Vinícius Zavam
Modified: 2019-11-29 15:18 UTC (History)
1 user (show)

See Also:


Attachments
D20638.diff (2.31 KB, patch)
2019-06-15 14:55 UTC, Vinícius Zavam
no flags Details | Diff
[PATCH] respect defines from 'sys/netinet/ip_carp.h' (2.34 KB, patch)
2019-06-18 06:45 UTC, Vinícius Zavam
no flags Details | Diff
ktrace__ifconfig.txt (21.69 KB, text/plain)
2019-06-18 09:15 UTC, Vinícius Zavam
no flags Details
ktrace__ifconfig_GOOD.txt (23.18 KB, text/plain)
2019-06-18 09:17 UTC, Vinícius Zavam
no flags Details
[PATCH] respect defines from 'sys/netinet/ip_carp.h' (2.56 KB, patch)
2019-06-19 16:15 UTC, Vinícius Zavam
no flags Details | Diff
[PATCH] respect defines from 'sys/netinet/ip_carp.h' (158.64 KB, patch)
2019-06-24 07:09 UTC, Vinícius Zavam
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vinícius Zavam freebsd_committer freebsd_triage 2019-06-15 14:55:10 UTC
Created attachment 205076 [details]
D20638.diff

based on information from man pages like carp(4) and ifconfig(8), some inconstant values popped out while I troubleshooted a HA setup using CARP.

  - advskew was able to be changed to values higher than CARP_MAXSKEW;
  - CARP advertisements collected via tcpdump were still using (respecting) its limit;

changing values on net.inet.carp.demotion does not increase advskew above the limit (expected, I think).

root@fw1-lab:~ # uname -UKvm
FreeBSD 13.0-CURRENT r348978 GENERIC  amd64 1300031 1300031

root@fw1-lab:~ # ifconfig vlan3131 vhid 10 advskew 254

root@fw1-lab:~ # echo $?
0

root@fw1-lab:~ # ifconfig vlan3131 | grep carp
        carp: MASTER vhid 10 advbase 1 advskew 254

root@fw1-lab:~ # tcpdump -c 1 -n -v -i vlan3131 carp -T carp
tcpdump: listening on vlan3131, link-type EN10MB (Ethernet), capture size 262144 bytes
15:56:59.299379 IP (tos 0xe0, ttl 255, id 0, offset 0, flags [DF], proto VRRP (112), length 56)
    172.31.31.1 > 224.0.0.18: carp 172.31.31.1 > 224.0.0.18: CARPv2-advertise 36: vhid=10 advbase=1 advskew=240 authlen=7 counter=8688083474654986394
1 packet captured
1 packet received by filter
0 packets dropped by kernel
Comment 1 Vinícius Zavam freebsd_committer freebsd_triage 2019-06-17 11:31:59 UTC
I was working on it without rebooting, on the fly (with fresh buildworld and installworld). after a reboot - or after a `service netif restart` -  I now see the following error:

  ifconfig: SIOCSVH: Invalid argument
Comment 2 Vinícius Zavam freebsd_committer freebsd_triage 2019-06-17 11:46:52 UTC
and, just to be clear: all worked as expected so far.

root@fw2-lab:~ # ifconfig vlan3131 vhid 10 advskew 254
ifconfig: advskew must be something between 0 and 240
root@fw2-lab:~ # echo $?
1

root@fw2-lab:~ # ifconfig vlan3131 vhid 10 advskew 234
root@fw2-lab:~ # echo $?
0

root@fw2-lab:~ # ifconfig vlan3131 | grep carp
        carp: MASTER vhid 10 advbase 1 advskew 234

root@fw2-lab:~ # ifconfig vlan3131 advskew 222
ifconfig: advskew requires vhid (must come first)

root@fw2-lab:~ # ifconfig vlan3131 advskew 222 vhid 10
ifconfig: advskew requires vhid (must come first)

root@fw2-lab:~ # ifconfig vlan3131 vhid 10 advskew 222
root@fw2-lab:~ # echo $?
0
Comment 3 Vinícius Zavam freebsd_committer freebsd_triage 2019-06-18 06:45:41 UTC
Created attachment 205196 [details]
[PATCH] respect defines from 'sys/netinet/ip_carp.h'

updating the patch to reflect last minor changes present on Phabricator.
Comment 4 Vinícius Zavam freebsd_committer freebsd_triage 2019-06-18 09:15:46 UTC
Created attachment 205197 [details]
ktrace__ifconfig.txt
Comment 5 Vinícius Zavam freebsd_committer freebsd_triage 2019-06-18 09:17:52 UTC
Created attachment 205198 [details]
ktrace__ifconfig_GOOD.txt

adding ktrace outputs for the following command:

  # ifconfig vlan1616 vhid 99 pass florentina 192.168.32.1/32

ktrace__ifconfig.txt (running the command for the first time);
ktrace__ifconfig_GOOD.txt (running the very same command command again).
Comment 6 Vinícius Zavam freebsd_committer freebsd_triage 2019-06-19 16:15:32 UTC
Created attachment 205222 [details]
[PATCH] respect defines from 'sys/netinet/ip_carp.h'

fix.

using demotion function fished from r228736
Comment 7 Vinícius Zavam freebsd_committer freebsd_triage 2019-06-24 07:09:04 UTC
Created attachment 205306 [details]
[PATCH] respect defines from 'sys/netinet/ip_carp.h'
Comment 8 Vinícius Zavam freebsd_committer freebsd_triage 2019-08-06 15:56:29 UTC
ping?
Comment 9 Vinícius Zavam freebsd_committer freebsd_triage 2019-11-29 15:18:36 UTC
https://reviews.freebsd.org/D20638