[sr-dev] [kamailio/kamailio] core: fix Makefile.defs error to include raw socket support (#1564)

Edwin Fine notifications at github.com
Wed Jun 13 22:36:08 CEST 2018


#### Pre-Submission Checklist

- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)

#### Type Of Change

- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)

#### Checklist:

- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)

#### Description

Compiling kamailio on Linux, unless `RAW_SOCKS` is set up otherwise,
should automatically enable raw sockets, according to `Makefile.defs`
[L97][]:

    # enable raw sockets
    RAW_SOCKS ?= yes
    ifeq ($(RAW_SOCKS),1)
        RAW_SOCKS = yes
    endif

By all indications, if `RAW_SOCKS` is unset, set to `1`, or set to `yes`
before this `ifeq` statement, it will be set to `yes` after the `endif`.

The issue arises later on in `Makefile.defs` [L1758][]:

    #os specific stuff
    ifeq ($(OS), linux)
    # by default use futexes if available
        use_futex= yes
        C_DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
                -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
                -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN
        ifneq ($(RAW_SOCKS), yes)  ### <--- The issue ###
            C_DEFS+= -DUSE_RAW_SOCKS
        endif

Clearly, the `ifneq` should be `ifeq`.

This commit fixes the issue by making the above change, and `kamailio`
should compile on Linux - by default - with raw sockets support unless
`RAW_SOCKS` is explicitly set prior to evaluation to something other
than `yes` or `1`.

[L97]: https://github.com/kamailio/kamailio/blob/a57a96f8fea3a5f7bff068ab0ea0d4c17c15bb65/src/Makefile.defs#L97
[L1758]: https://github.com/kamailio/kamailio/blob/a57a96f8fea3a5f7bff068ab0ea0d4c17c15bb65/src/Makefile.defs#L1758
You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/1564

-- Commit Summary --

  * core: fix Makefile.defs error to include raw socket support

-- File Changes --

    M src/Makefile.defs (2)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/1564.patch
https://github.com/kamailio/kamailio/pull/1564.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1564
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180613/6dec08fa/attachment.html>


More information about the sr-dev mailing list