misc/142741: Wrong use of constant PF_UNSPEC in libipsec/pfkey.c, should be SADB_SATYPE_UNSPEC

Matthijs Kooiman matthijs at stdin.nl
Tue Jan 12 10:50:01 UTC 2010


>Number:         142741
>Category:       misc
>Synopsis:       Wrong use of constant PF_UNSPEC in libipsec/pfkey.c, should be SADB_SATYPE_UNSPEC
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 12 10:50:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Matthijs Kooiman
>Release:        HEAD
>Organization:
I.C.T.S.V. Inter-Actief
>Environment:
>Description:
While debugging a problem with IPSEC on my 6.4 box, I noticed that libipsec uses the wrong constant, as per subject. This occurs in lib/libipsec/pfkey.c:665 in pfkey_send_register in both my 6.4 version as in the HEAD version (http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libipsec/pfkey.c?annotate=1.9.10.1.2.1):

    if (satype == PF_UNSPEC) {

Line 1389 and this snippet from sbin/setkey/setkey.c show that it should indeed be SADB_SATYPE_UNSPEC

    if (pfkey_send_register(so, SADB_SATYPE_UNSPEC) < 0)
        return -1;                                                         

Since these constants both have the value 0, this wrong constant has never caused any problems, but for clarity and to prevent possible future bugs, it's probably best to change it?

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list