Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 573996

Summary: ccsd does not log what IPs are used for binding/sending packets to
Product: Red Hat Enterprise Linux 5 Reporter: Jaroslav Kortus <jkortus>
Component: cmanAssignee: Lon Hohberger <lhh>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: cluster-maint, iannis
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cman-2.0.115-64.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 22:32:32 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
Updated patch none

Description Jaroslav Kortus 2010-03-16 11:47:51 UTC
Description of problem:
This is continuation of bug 517399.

Lon Hohberger      2010-03-15 16:17:25 EDT
  if (bind(ccsd_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
    log_err("Unable to bind to socket.\n");
    close(ccsd_fd);
    exit(EXIT_FAILURE);
  }
This is cnx_mgr.c:400.  The other bind() calls are indeed fixed.    

This is last missing fix for ccsd logging improvement.

Version-Release number of selected component (if applicable):
cman-2.0.115-33.el5

How reproducible:
always

Steps to Reproduce:
1. nc -l 50008
2. ccsd
3. check /var/log/messages
  
Actual results:
no IP specified

Expected results:
more verbose logging 

Additional info:

Comment 3 Jaroslav Kortus 2010-11-22 17:50:04 UTC
The same procedure now prints:
Unable to bind to ipv4 frontend socket, but inet_ntop returned NULL pointer: Address already in use.

That's not much more help than before. I don't fully understand why the data is dependent on the result of "res = " assignment when all the useful data are in the bind call already. Could you please put at least the port information there?

bind(4, {sa_family=AF_INET, sin_port=htons(50006), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRINUSE (Address already in use)

results in

Unable to bind to ipv4 frontend socket, but inet_ntop returned NULL pointer: Address already in use

Also, looking at "res = inet_ntop(AF_INET,...", will it ever print the "nice" form for ipv6 address? Now it prints the same as for ipv4. I'm not a c-programmer, so that's just my curiosity :).

Comment 4 Lon Hohberger 2010-11-29 15:54:18 UTC
'if (!res)' is wrong.

It should be 'if (res)'.

Comment 5 Lon Hohberger 2010-11-30 15:05:26 UTC
Created attachment 463749 [details]
Updated patch

Comment 6 Lon Hohberger 2010-11-30 15:06:19 UTC
With updated patch:

Nov 30 10:03:46 rhel5-1 ccsd[28366]: Starting ccsd DEVEL.1291129352: 
Nov 30 10:03:46 rhel5-1 ccsd[28366]:  Built: Nov 30 2010 10:03:42 
Nov 30 10:03:46 rhel5-1 ccsd[28366]:  Copyright (C) Red Hat, Inc.  2004  All rights reserved. 
Nov 30 10:03:46 rhel5-1 ccsd[28366]: Unable to bind socket addr: 0.0.0.0, port: 50008, proto: 2: Address already in use

Comment 9 Lon Hohberger 2010-11-30 18:55:23 UTC
cman-2.0.115-64.el5 unit test results:

Nov 30 13:52:31 rhel5-1 ccsd[31646]: Starting ccsd 2.0.115:
Nov 30 13:52:31 rhel5-1 ccsd[31646]:  Built: Nov 30 2010 13:44:25
Nov 30 13:52:31 rhel5-1 ccsd[31646]:  Copyright (C) Red Hat, Inc.  2004  All rights reserved.
Nov 30 13:52:32 rhel5-1 ccsd[31646]: Unable to bind socket addr: 0.0.0.0, port: 50008, proto: 2: Address already in use

Comment 12 errata-xmlrpc 2011-01-13 22:32:32 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0036.html