Bug 196095

Summary: Ucarp does not update arp cache if your master comes up after losing link.
Product: [Fedora] Fedora Reporter: Tautvydas Bruzas <vitiho>
Component: ucarpAssignee: Matthias Saou <matthias>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: medium    
Version: 5CC: extras-qa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-06-30 13:17:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for ucarp, which detects a link state and sends out gratuitous arp packet when master regains link state.
none
Patch from 1.3 snapshot none

Description Tautvydas Bruzas 2006-06-20 22:52:43 UTC
Description of problem:

If you have two servers running ucarp, and before them you have any
router, if master server goes down backup automatically takes over and
sends gratuitous arp packet to update router's arp cache. Problem occurs
then link  to master goes down (for example unplug network cable from a
switch, or switch dies). In that case backup takes over, same as in
previous example, but when link goes back up master does not sends out
gratuitous arp and that results that server is not accessible (amount of
time depends on router's arp cache timeout).

Version-Release number of selected component (if applicable):

ucarp 1.2 and bellow

How reproducible:

easy.

Steps to Reproduce:
1. Unplug network cable from master machine
2. Try to ping HA ip.
3. Plug network cable back in
4. Try to ping that IP once more.

Workaround:
You can use something like adding to ifdown script on backup server ssh
and run arping command on master, you can not add to ifup on master
this, because master is not detecting any change that's why it's not
sending out gratuitous arp packet.

Patch attached:

Comment 1 Tautvydas Bruzas 2006-06-20 22:52:43 UTC
Created attachment 131233 [details]
Patch for ucarp, which detects a link state and sends out gratuitous arp packet when master regains link state.

Comment 2 Matthias Saou 2006-06-20 22:57:38 UTC
Interesting. Have you also submitted the patch upstream? I would really prefer
not having specific fixes in the Fedora packages only, so the ideal would be to
either have a new release with the fix available, or if that's not planned
anytime soon, I could include the approved patch anyway.

Comment 3 Tautvydas Bruzas 2006-06-20 23:01:40 UTC
Yes I did, didn't get any answer yet (I submitted it two weeks ago).

Comment 4 Tautvydas Bruzas 2006-06-20 23:06:28 UTC
I checked authors page, and looks like in version 1.3 (it's still in snapshots),
path is included.

Comment 5 Matthias Saou 2006-06-21 15:14:41 UTC
Indeed, it seems to be included in the 1.3 snapshot. But extracting the code
from it, I get a slightly different diff. See attached patch (with #ifdefs for
SIOCGIFFLAGS) and tell me if it seems fine to you, then I'll include it.

Comment 6 Matthias Saou 2006-06-21 15:15:32 UTC
Created attachment 131287 [details]
Patch from 1.3 snapshot

Comment 7 Tautvydas Bruzas 2006-06-21 17:44:47 UTC
(In reply to comment #5)
> Indeed, it seems to be included in the 1.3 snapshot. But extracting the code
> from it, I get a slightly different diff. See attached patch (with #ifdefs for
> SIOCGIFFLAGS) and tell me if it seems fine to you, then I'll include it.

Yep, I noticed a difference, patch looks good. Author added checking for
interface name (it won't cause buffer overflow in my patch as well as we both
using strncpy, but it won't give an error in my case), and added checking for
SIOCGIFFLAGS if they are defined on the system (because of that he moved portion
of code there interface looses link state).

Comment 8 Matthias Saou 2006-06-22 15:38:53 UTC
I've updated the Extras development package with this patch included. Please let
me know how it goes, and I'll backport it to Extras 5 if all is fine. Also,
don't hesitate to ping me when 1.3 final gets released so that I can update the
package.

Comment 9 Matthias Saou 2006-06-30 13:17:50 UTC
I've just triggered a rebuild of the 1.2 + fix package for FC-5.