devinteske

keepalived porting effort

Jun 22nd, 2018
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.46 KB | None | 0 0
  1. dteske@nplusfreebsd.sf keepalived $ ls
  2. .indent.pro INSTALL build_smule.sh* keepalived/
  3. .travis.yml Makefile.am clean_smule.sh* keepalived.spec.in
  4. AUTHOR README.md configure.ac lib/
  5. CONTRIBUTORS TODO doc/ patch_smule.txt
  6. COPYING bin/ docker/ snap/
  7. ChangeLog bin_install/ genhash/ test/
  8. Dockerfile build_setup* goodies/ tools/
  9. dteske@nplusfreebsd.sf keepalived $ ./build_smule.sh
  10. Hmm... Looks like a unified diff to me...
  11. The text leading up to this was:
  12. --------------------------
  13. |--- configure.ac.orig 2018-06-22 03:53:05.089252000 +0000
  14. |+++ configure.ac 2018-06-22 03:54:02.647049000 +0000
  15. --------------------------
  16. Patching file configure.ac using Plan A...
  17. Hunk #1 succeeded at 427.
  18. Hunk #2 succeeded at 436.
  19. Hmm... The next patch looks like a unified diff to me...
  20. The text leading up to this was:
  21. --------------------------
  22. |--- lib/utils.h.orig 2018-06-22 04:21:26.596551000 +0000
  23. |+++ lib/utils.h 2018-06-22 04:12:28.596077000 +0000
  24. --------------------------
  25. Patching file lib/utils.h using Plan A...
  26. Hunk #1 succeeded at 30.
  27. Hmm... The next patch looks like a unified diff to me...
  28. The text leading up to this was:
  29. --------------------------
  30. |--- lib/notify.c.orig 2018-06-22 05:00:23.289907000 +0000
  31. |+++ lib/notify.c 2018-06-22 05:01:48.485388000 +0000
  32. --------------------------
  33. Patching file lib/notify.c using Plan A...
  34. Hunk #1 succeeded at 33.
  35. Hunk #2 succeeded at 56.
  36. Hunk #3 succeeded at 84.
  37. Hunk #4 succeeded at 150.
  38. Hunk #5 succeeded at 266.
  39. Hmm... The next patch looks like a unified diff to me...
  40. The text leading up to this was:
  41. --------------------------
  42. |--- lib/scheduler.c.orig 2018-06-22 05:03:20.622974000 +0000
  43. |+++ lib/scheduler.c 2018-06-22 05:04:32.956661000 +0000
  44. --------------------------
  45. Patching file lib/scheduler.c using Plan A...
  46. Hunk #1 succeeded at 51.
  47. Hunk #2 succeeded at 296.
  48. Hmm... The next patch looks like a unified diff to me...
  49. The text leading up to this was:
  50. --------------------------
  51. |--- lib/parser.c.orig 2018-06-22 05:14:35.174543000 +0000
  52. |+++ lib/parser.c 2018-06-22 05:15:22.254116000 +0000
  53. --------------------------
  54. Patching file lib/parser.c using Plan A...
  55. Hunk #1 succeeded at 34.
  56. Hunk #2 succeeded at 504.
  57. done
  58. ==> ./build_setup
  59. configure.ac:254: installing './ar-lib'
  60. configure.ac:244: installing './compile'
  61. configure.ac:98: installing './install-sh'
  62. configure.ac:98: installing './missing'
  63. genhash/Makefile.am: installing './depcomp'
  64. ==> ./configure
  65. checking for a BSD-compatible install... /usr/bin/install -c
  66. checking whether build environment is sane... yes
  67. checking for a thread-safe mkdir -p... ./install-sh -c -d
  68. checking for gawk... no
  69. checking for mawk... no
  70. checking for nawk... nawk
  71. checking whether make sets $(MAKE)... yes
  72. checking whether make supports nested variables... yes
  73. checking whether make supports nested variables... (cached) yes
  74. checking for pkg-config... /usr/local/bin/pkg-config
  75. checking pkg-config is at least version 0.9.0... yes
  76. checking for gcc... gcc
  77. checking whether the C compiler works... yes
  78. checking for C compiler default output file name... a.out
  79. checking for suffix of executables...
  80. checking whether we are cross compiling... no
  81. checking for suffix of object files... o
  82. checking whether we are using the GNU C compiler... yes
  83. checking whether gcc accepts -g... yes
  84. checking for gcc option to accept ISO C89... none needed
  85. checking whether gcc understands -c and -o together... yes
  86. checking for style of include used by make... GNU
  87. checking dependency style of gcc... gcc3
  88. checking whether make sets $(MAKE)... (cached) yes
  89. checking for ranlib... ranlib
  90. checking for grep that handles long lines and -e... /usr/bin/grep
  91. checking whether ln -s works... yes
  92. checking for a sed that does not truncate output... /usr/bin/sed
  93. checking for strip... strip
  94. checking for ldd... ldd
  95. checking for ar... ar
  96. checking the archiver (ar) interface... ar
  97. checking for -Wimplicit-fallthrough... no
  98. checking for PIE support... yes
  99. checking for -Wformat -Werror=format-security support... yes
  100. checking for -Wp,-D_FORTIFY_SOURCE=2 support... yes
  101. checking for -fexceptions support... yes
  102. checking for -fstack-protector-strong support... yes
  103. checking for --param=ssp-buffer-size=4 support... yes
  104. checking for -grecord-gcc-switches support... yes
  105. checking for -Wl,-z,relro support... yes
  106. checking for -Wl,-z,now support... yes
  107. checking how to run the C preprocessor... gcc -E
  108. checking for egrep... /usr/bin/grep -E
  109. checking for ANSI C header files... Segmentation fault (core dumped)
  110. no
  111. checking for sys/types.h... yes
  112. checking for sys/stat.h... yes
  113. checking for stdlib.h... yes
  114. checking for string.h... yes
  115. checking for memory.h... yes
  116. checking for strings.h... yes
  117. checking for inttypes.h... yes
  118. checking for stdint.h... yes
  119. checking for unistd.h... yes
  120. checking arpa/inet.h usability... yes
  121. checking arpa/inet.h presence... yes
  122. checking for arpa/inet.h... yes
  123. checking fcntl.h usability... yes
  124. checking fcntl.h presence... yes
  125. checking for fcntl.h... yes
  126. checking limits.h usability... yes
  127. checking limits.h presence... yes
  128. checking for limits.h... yes
  129. checking netdb.h usability... yes
  130. checking netdb.h presence... yes
  131. checking for netdb.h... yes
  132. checking netinet/in.h usability... yes
  133. checking netinet/in.h presence... yes
  134. checking for netinet/in.h... yes
  135. checking for stdint.h... (cached) yes
  136. checking for stdlib.h... (cached) yes
  137. checking for string.h... (cached) yes
  138. checking sys/ioctl.h usability... yes
  139. checking sys/ioctl.h presence... yes
  140. checking for sys/ioctl.h... yes
  141. checking sys/param.h usability... yes
  142. checking sys/param.h presence... yes
  143. checking for sys/param.h... yes
  144. checking sys/socket.h usability... yes
  145. checking sys/socket.h presence... yes
  146. checking for sys/socket.h... yes
  147. checking sys/time.h usability... yes
  148. checking sys/time.h presence... yes
  149. checking for sys/time.h... yes
  150. checking syslog.h usability... yes
  151. checking syslog.h presence... yes
  152. checking for syslog.h... yes
  153. checking for unistd.h... (cached) yes
  154. checking for stdbool.h that conforms to C99... yes
  155. checking for _Bool... yes
  156. checking for inline... inline
  157. checking for int64_t... yes
  158. checking for pid_t... yes
  159. checking for size_t... yes
  160. checking for uint16_t... yes
  161. checking for uint32_t... yes
  162. checking for uint64_t... yes
  163. checking for uint8_t... yes
  164. checking for an ANSI C-conforming const... yes
  165. checking vfork.h usability... no
  166. checking vfork.h presence... no
  167. checking for vfork.h... no
  168. checking for fork... yes
  169. checking for vfork... yes
  170. checking for working fork... yes
  171. checking for working vfork... (cached) yes
  172. checking for stdlib.h... (cached) yes
  173. checking for GNU libc compatible malloc... yes
  174. checking for stdlib.h... (cached) yes
  175. checking for GNU libc compatible realloc... yes
  176. checking for dup2... yes
  177. checking for getcwd... yes
  178. checking for gettimeofday... yes
  179. checking for memmove... yes
  180. checking for memset... yes
  181. checking for select... yes
  182. checking for setenv... yes
  183. checking for socket... yes
  184. checking for strcasecmp... yes
  185. checking for strchr... yes
  186. checking for strdup... yes
  187. checking for strerror... yes
  188. checking for strpbrk... yes
  189. checking for strstr... yes
  190. checking for strtol... yes
  191. checking for strtoul... yes
  192. checking for uname... yes
  193. checking for pipe2... yes
  194. checking for signalfd... no
  195. checking for inotify_init1... no
  196. checking whether ETHERTYPE_IPV6 is declared... no
  197. checking openssl/ssl.h usability... yes
  198. checking openssl/ssl.h presence... yes
  199. checking for openssl/ssl.h... yes
  200. checking openssl/err.h usability... yes
  201. checking openssl/err.h presence... yes
  202. checking for openssl/err.h... yes
  203. checking openssl/md5.h usability... yes
  204. checking openssl/md5.h presence... yes
  205. checking for openssl/md5.h... yes
  206. checking for MD5_Init in -lcrypto... yes
  207. checking for SSL_CTX_new in -lssl... yes
  208. checking SSL_set_tlsext_host_name() - may be a definition... yes
  209. checking for SSL_CTX_set_verify_depth... yes
  210. checking for SSL_set0_rbio... no
  211. checking for OPENSSL_init_crypto... no
  212. checking for nl_socket_modify_cb in -lnl... no
  213. configure: WARNING: keepalived will be built without libnl support.
  214. checking for magic_open in -lmagic... yes
  215. checking whether RTA_ENCAP is declared... no
  216. checking whether RTA_EXPIRES is declared... no
  217. checking whether RTA_NEWDST is declared... no
  218. checking whether RTA_PREF is declared... no
  219. checking whether FRA_SUPPRESS_PREFIXLEN is declared... no
  220. checking whether FRA_SUPPRESS_IFGROUP is declared... no
  221. checking whether FRA_TUN_ID is declared... no
  222. checking whether RTAX_CC_ALGO is declared... no
  223. checking whether RTAX_QUICKACK is declared... no
  224. checking whether RTEXT_FILTER_SKIP_STATS is declared... no
  225. checking whether FRA_L3MDEV is declared... no
  226. checking whether FRA_UID_RANGE is declared... no
  227. checking whether RTAX_FASTOPEN_NO_COOKIE is declared... no
  228. checking whether RTA_VIA is declared... no
  229. checking whether FRA_OIFNAME is declared... no
  230. checking whether FRA_PROTOCOL is declared... no
  231. checking whether FRA_IP_PROTO is declared... no
  232. checking whether FRA_SPORT_RANGE is declared... no
  233. checking whether FRA_DPORT_RANGE is declared... no
  234. checking whether IFA_FLAGS is declared... no
  235. checking whether LWTUNNEL_ENCAP_MPLS is declared... no
  236. checking whether LWTUNNEL_ENCAP_ILA is declared... no
  237. checking linux/netfilter/x_tables.h usability... no
  238. checking linux/netfilter/x_tables.h presence... no
  239. checking for linux/netfilter/x_tables.h... no
  240. checking for linux/if.h and net/if.h namespace collision... yes
  241. checking for linux/if_ether.h then netinet/if_ether.h namespace collision... yes
  242. checking for libiptc/libiptc.h linux/if.h and net/if.h namespace collision... yes
  243. checking linux/ip_vs.h usability... no
  244. checking linux/ip_vs.h presence... no
  245. checking for linux/ip_vs.h... no
  246. checking whether IPVS_DEST_ATTR_ADDR_FAMILY is declared... no
  247. checking whether IPVS_DAEMON_ATTR_SYNC_MAXLEN is declared... no
  248. checking whether IPVS_DAEMON_ATTR_MCAST_GROUP is declared... no
  249. checking whether IPVS_DAEMON_ATTR_MCAST_GROUP6 is declared... no
  250. checking whether IPVS_DAEMON_ATTR_MCAST_PORT is declared... no
  251. checking whether IPVS_DAEMON_ATTR_MCAST_TTL is declared... no
  252. checking whether IPVS_SVC_ATTR_STATS64 is declared... no
  253. checking whether IPVS_DEST_ATTR_STATS64 is declared... no
  254. checking whether IFLA_MACVLAN_MODE is declared... no
  255. checking whether MACVLAN_MODE_PRIVATE is declared... no
  256. checking whether SOCK_NONBLOCK is declared... yes
  257. checking whether SOCK_CLOEXEC is declared... yes
  258. checking whether IPVS_SVC_ATTR_PE_NAME is declared... no
  259. checking whether O_PATH is declared... no
  260. checking whether GLOB_BRACE is declared... yes
  261. checking whether FRA_SRC is declared... no
  262. checking whether SO_MARK is declared... no
  263. checking whether CLONE_NEWNET is declared... no
  264. checking for setns... no
  265. checking whether SCHED_RR is declared... yes
  266. checking whether RLIMIT_RTTIME is declared... no
  267. checking whether SCHED_RESET_ON_FORK is declared... no
  268. checking for sphinx-build... No
  269. checking for rpmbuild... No
  270. ./configure: rpm: not found
  271.  
  272. checking that generated files are newer than configure... done
  273. configure: creating ./config.status
  274. config.status: creating Makefile
  275. config.status: creating keepalived/Makefile
  276. config.status: creating lib/Makefile
  277. config.status: creating keepalived/core/Makefile
  278. config.status: creating keepalived.spec
  279. config.status: creating genhash/Makefile
  280. config.status: creating keepalived/check/Makefile
  281. config.status: creating keepalived/vrrp/Makefile
  282. config.status: creating keepalived/bfd/Makefile
  283. config.status: creating doc/Makefile
  284. config.status: creating bin_install/Makefile
  285. config.status: creating keepalived/dbus/Makefile
  286. config.status: creating keepalived/etc/Makefile
  287. config.status: creating keepalived/etc/init/Makefile
  288. config.status: creating keepalived/etc/init.d/Makefile
  289. config.status: creating lib/config.h
  290. config.status: lib/config.h is unchanged
  291. config.status: executing depfiles commands
  292.  
  293. Keepalived configuration
  294. ------------------------
  295. Keepalived version : 2.0.4
  296. Compiler : gcc
  297. Preprocessor flags :
  298. Compiler flags : -Wall -Wunused -Wstrict-prototypes -Wextra -Winit-self -g -O2 -D_GNU_SOURCE -fPIE -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
  299. Linker flags : -pie
  300. Extra Lib : -lcrypto -lssl -lmagic
  301. Use IPVS Framework : Yes
  302. IPVS use libnl : No
  303. IPVS syncd attributes : No
  304. IPVS 64 bit stats : No
  305. fwmark socket support : No
  306. Use VRRP Framework : Yes
  307. Use VRRP VMAC : No
  308. Use VRRP authentication : Yes
  309. With ip rules/routes : No
  310. Use BFD Framework : No
  311. SNMP vrrp support : No
  312. SNMP checker support : No
  313. SNMP RFCv2 support : No
  314. SNMP RFCv3 support : No
  315. DBUS support : No
  316. SHA1 support : No
  317. Use Json output : No
  318. libnl version : None
  319. Use IPv4 devconf : No
  320. Use libiptc : No
  321. Use libipset : No
  322. init type : undetected
  323. Build genhash : Yes
  324. Build documentation : No
  325.  
  326. *** WARNING - this build will not support IPVS with IPv6. Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.
  327.  
  328. ==> gmake
  329. Making all in lib
  330. gmake[1]: Entering directory '/usr/home/dteske/src/smule/pkgcenter/depend/keepalived/lib'
  331. -p: not found
  332. [: git: unexpected operator
  333. (CDPATH="${ZSH_VERSION+.}:" && cd .. && /bin/sh /home/dteske/src/smule/pkgcenter/depend/keepalived/missing autoheader)
  334. rm -f stamp-h1
  335. touch config.h.in
  336. cd .. && /bin/sh ./config.status lib/config.h
  337. config.status: creating lib/config.h
  338. config.status: lib/config.h is unchanged
  339. gmake all-am
  340. gmake[2]: Entering directory '/usr/home/dteske/src/smule/pkgcenter/depend/keepalived/lib'
  341. CC memory.o
  342. CC utils.o
  343. CC notify.o
  344. CC timer.o
  345. CC scheduler.o
  346. CC vector.o
  347. CC list.o
  348. CC html.o
  349. CC parser.o
  350. CC signals.o
  351. CC logger.o
  352. CC assert.o
  353. CC rttables.o
  354. rttables.c:29:29: fatal error: linux/rtnetlink.h: No such file or directory
  355. compilation terminated.
  356. gmake[2]: *** [Makefile:388: rttables.o] Error 1
  357. gmake[2]: Leaving directory '/usr/home/dteske/src/smule/pkgcenter/depend/keepalived/lib'
  358. gmake[1]: *** [Makefile:309: all] Error 2
  359. gmake[1]: Leaving directory '/usr/home/dteske/src/smule/pkgcenter/depend/keepalived/lib'
  360. gmake: *** [Makefile:425: all-recursive] Error 1
  361. dteske@nplusfreebsd.sf keepalived $ wc -l patch_smule.txt
  362. 150 patch_smule.txt
  363. dteske@nplusfreebsd.sf keepalived $ wc -l build_smule.sh
  364. 77 build_smule.sh
  365. dteske@nplusfreebsd.sf keepalived $ wc -l clean_smule.sh
  366. 68 clean_smule.sh
  367. dteske@nplusfreebsd.sf keepalived $ ls -1 lib/*.c
  368. lib/assert.c
  369. lib/html.c
  370. lib/list.c
  371. lib/logger.c
  372. lib/memory.c
  373. lib/notify.c
  374. lib/old_socket.c
  375. lib/parser.c
  376. lib/rttables.c
  377. lib/scheduler.c
  378. lib/signals.c
  379. lib/timer.c
  380. lib/utils.c
  381. lib/vector.c
  382. dteske@nplusfreebsd.sf keepalived $ ls -1 lib/*.c | wc -l
  383. 14
  384. dteske@nplusfreebsd.sf keepalived $ ls -1 lib/*.o | wc -l
  385. 12
  386. dteske@nplusfreebsd.sf keepalived $ bc
  387. 12*100/14
  388. 85
  389. dteske@nplusfreebsd.sf keepalived $ cat build_smule.sh
  390. #!/bin/sh
  391. ############################################################ IDENT(1)
  392. #
  393. # $Title: Script to build keepalived and install it to package sandbox $
  394. # $Copyright: 2017-2018 Devin Teske. All rights reserved. $
  395. # $Smule: pkgcenter.git/master/depend/keepalived/build_smule.sh 2018-06-22 04:32:09 +0000 dteske $
  396. #
  397. ############################################################ GLOBALS
  398.  
  399. #
  400. # ANSI
  401. #
  402. ESC=$( :| awk 'BEGIN { printf "%c", 27 }' )
  403. SI_BLD_ON="$ESC[1m"
  404. ANSI_BLD_OFF="$ESC[22m"
  405. ANSI_GRN_ON="$ESC[32m"
  406. ANSI_FGC_OFF="$ESC[39m"
  407.  
  408. ############################################################ FUNCTIONS
  409.  
  410. eval2()
  411. {
  412. echo "$ANSI_BLD_ON$ANSI_GRN_ON==>$ANSI_FGC_OFF $*$ANSI_BLD_OFF"
  413. eval "$@"
  414. }
  415.  
  416. ############################################################ MAIN
  417.  
  418. set -e
  419.  
  420. #
  421. # Install dependencies
  422. #
  423. items_needed=
  424. # bin=someprog:pkg=somepkg \
  425. # file=/path/to/some_file:pkg=somepkg \
  426. # lib=somelib.so:pkg=somepkg \
  427. for entry in \
  428. bin=aclocal:pkg=automake \
  429. bin=automake:pkg=automake \
  430. bin=autoheader:pkg=autoconf \
  431. bin=autoreconf:pkg=autoconf \
  432. bin=gmake:pkg=gmake \
  433. ; do
  434. check="${entry%%:*}"
  435. item="${check#*=}"
  436. case "$check" in
  437. bin=*) type "$item" > /dev/null 2>&1 && continue ;;
  438. file=*) [ -e "$item" ] && continue ;;
  439. lib=*) ldconfig -p | awk -v lib="$item" \
  440. '$1==lib{exit f++}END{exit !f}' && continue ;;
  441. *) continue
  442. esac
  443. pkg="${entry#*:}"
  444. pkgname="${pkg#*=}"
  445. items_needed="$items_needed $pkgname"
  446. done
  447. [ "$items_needed" ] && eval2 sudo pkg install $items_needed
  448.  
  449. #
  450. # Build software
  451. #
  452. patch -N < patch_smule.txt ||:
  453. [ -e configure ] || eval2 ./build_setup
  454. [ -e Makefile ] || eval2 ./configure
  455. eval2 gmake
  456.  
  457. #
  458. # Install software to package sandbox
  459. #
  460. [ -e install ] || eval2 mkdir -p install
  461. eval2 gmake DESTDIR=$PWD/install install
  462. eval2 : SUCCESS
  463.  
  464. ################################################################################
  465. # END
  466. ################################################################################
  467. dteske@nplusfreebsd.sf keepalived $ cat clean_smule.sh
  468. #!/bin/sh
  469. ############################################################ IDENT(1)
  470. #
  471. # $Title: Script to clean keepalived $
  472. # $Copyright: 2017-2018 Devin Teske. All rights reserved. $
  473. # $Smule: pkgcenter.git/master/depend/keepalived/clean_smule.sh 2018-06-22 05:01:06 +0000 dteske $
  474. #
  475. ############################################################ GLOBALS
  476.  
  477. #
  478. # ANSI
  479. #
  480. ESC=$( :| awk 'BEGIN { printf "%c", 27 }' )
  481. ANSI_BLD_ON="$ESC[1m"
  482. ANSI_BLD_OFF="$ESC[22m"
  483. ANSI_GRN_ON="$ESC[32m"
  484. ANSI_FGC_OFF="$ESC[39m"
  485.  
  486. ############################################################ FUNCTIONS
  487.  
  488. eval2()
  489. {
  490. echo "$ANSI_BLD_ON$ANSI_GRN_ON==>$ANSI_FGC_OFF $*$ANSI_BLD_OFF"
  491. eval "$@"
  492. }
  493.  
  494. ############################################################ MAIN
  495.  
  496. patch -RN < patch_smule.txt
  497.  
  498. set -e
  499. for item in \
  500. *.orig \
  501. *.rej \
  502. */*/*/Makefile \
  503. */*/*/Makefile.in \
  504. */*/.deps/ \
  505. */*/Makefile \
  506. */*/Makefile.in \
  507. */.deps/ \
  508. */Makefile \
  509. */Makefile.in \
  510. Makefile \
  511. Makefile.in \
  512. aclocal.m4 \
  513. ar-lib \
  514. autom4te.cache/ \
  515. compile \
  516. config.log \
  517. config.status \
  518. configure \
  519. depcomp \
  520. install-sh \
  521. keepalived.spec \
  522. lib/*.o \
  523. lib/*.orig \
  524. lib/*.rej \
  525. lib/config.h.in \
  526. lib/config.h.in~ \
  527. lib/stamp-h1 \
  528. missing \
  529. ;do
  530. eval2 rm -Rf "$item"
  531. done
  532.  
  533. ################################################################################
  534. # END
  535. ################################################################################
  536. dteske@nplusfreebsd.sf keepalived $ cat patch_smule.txt
  537. --- configure.ac.orig 2018-06-22 03:53:05.089252000 +0000
  538. +++ configure.ac 2018-06-22 03:54:02.647049000 +0000
  539. @@ -427,7 +427,7 @@ AC_SUBST(KA_LIBS)
  540. # Checks for libraries.
  541.  
  542. # Checks for header files.
  543. -AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/prctl.h sys/socket.h sys/time.h syslog.h unistd.h],
  544. +AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h],
  545. [], [AC_MSG_ERROR([Missing/unusable system header file <$ac_header>])])
  546.  
  547. # check for kernel headers
  548. @@ -436,24 +436,6 @@ CPPFLAGS="$CPPFLAGS $kernelinc"
  549. dnl -- <linux/netlink.h> needed <sys/socket.h> until Linux 3.1
  550. dnl -- using AC_CHECK_HEADER causes a horrible error message for the user
  551. NETLINK_EXTRA_INCLUDE=
  552. -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  553. - #include <linux/netlink.h>
  554. - ]])], [],
  555. - [AC_CHECK_HEADER([linux/netlink.h],
  556. - [
  557. - AC_DEFINE([NETLINK_H_NEEDS_SYS_SOCKET_H], [ 1 ], [Define to 1 if <linux/netlink.h> needs <sys/socket.h>])
  558. - NETLINK_EXTRA_INCLUDE="#include <sys/socket.h>"
  559. - ], [AC_MSG_ERROR([Missing/unusable kernel header file <linux/netlink.h>])],
  560. - [[#include <sys/socket.h>]])])
  561. -
  562. -AC_CHECK_HEADERS([asm/types.h linux/ethtool.h linux/icmpv6.h linux/if_ether.h linux/if_packet.h linux/ip.h linux/sockios.h linux/types.h],
  563. - [], [AC_MSG_ERROR([Missing/unusable kernel header file <$ac_header>])])
  564. -AC_CHECK_HEADERS([linux/fib_rules.h linux/if_addr.h linux/if_link.h],
  565. - [], [AC_MSG_ERROR([Missing/unusable kernel header file <$ac_header>])],
  566. - [[$NETLINK_EXTRA_INCLUDE]])
  567. -AC_CHECK_HEADERS([linux/if_arp.h],
  568. - [], [AC_MSG_ERROR([Missing/unusable <$ac_header>])],
  569. - [[#include <sys/socket.h>]])
  570. CPPFLAGS="$SAV_CPPFLAGS"
  571.  
  572. # Checks for typedefs, structures, and compiler characteristics.
  573. --- lib/utils.h.orig 2018-06-22 04:21:26.596551000 +0000
  574. +++ lib/utils.h 2018-06-22 04:12:28.596077000 +0000
  575. @@ -30,6 +30,7 @@
  576. #include <stdint.h>
  577. #include <stdbool.h>
  578. #include <sys/socket.h>
  579. +#define s6_addr32 __u6_addr.__u6_addr32
  580. #include <netinet/in.h>
  581. #include <stdio.h>
  582. #ifdef _DEBUG_
  583. --- lib/notify.c.orig 2018-06-22 05:00:23.289907000 +0000
  584. +++ lib/notify.c 2018-06-22 05:01:48.485388000 +0000
  585. @@ -33,7 +33,20 @@
  586. #include <pwd.h>
  587. #include <sys/resource.h>
  588. #include <limits.h>
  589. -#include <sys/prctl.h>
  590. +#include <sys/wait.h>
  591. +
  592. +# define __ssp_bos0(ptr) __builtin_object_size (ptr, 0)
  593. +
  594. +#define mempcpy(dest, src, len) \
  595. + ((__ssp_bos0 (dest) != (size_t) -1) \
  596. + ? __builtin___mempcpy_chk (dest, src, len, __ssp_bos0 (dest)) \
  597. + : __mempcpy_ichk (dest, src, len))
  598. +static inline __attribute__((__always_inline__)) void *
  599. +__mempcpy_ichk (void *__restrict__ __dest, const void *__restrict__ __src,
  600. + size_t __len)
  601. +{
  602. + return __builtin___mempcpy_chk (__dest, __src, __len, __ssp_bos0 (__dest));
  603. +}
  604.  
  605. #include "notify.h"
  606. #include "signals.h"
  607. @@ -43,6 +56,8 @@
  608. #include "keepalived_magic.h"
  609. #include "scheduler.h"
  610.  
  611. +extern char **environ;
  612. +
  613. /* Default user/group for script execution */
  614. uid_t default_script_uid;
  615. gid_t default_script_gid;
  616. @@ -69,9 +84,6 @@ set_privileges(uid_t uid, gid_t gid)
  617. {
  618. int retval;
  619.  
  620. - /* Ensure we receive SIGTERM if our parent process dies */
  621. - prctl(PR_SET_PDEATHSIG, SIGTERM);
  622. -
  623. /* If we have increased our priority, set it to default for the script */
  624. if (cur_prio != INT_MAX)
  625. cur_prio = getpriority(PRIO_PROCESS, 0);
  626. @@ -138,9 +150,6 @@ notify_fifo_exec(thread_master_t *m, int
  627. set_privileges(script->uid, script->gid);
  628.  
  629. if (script->flags | SC_EXECABLE) {
  630. - /* If keepalived dies, we want the script to die */
  631. - prctl(PR_SET_PDEATHSIG, SIGTERM);
  632. -
  633. execve(script->args[0], script->args, environ);
  634.  
  635. if (errno == EACCES)
  636. @@ -257,9 +266,6 @@ system_call(const notify_script_t* scrip
  637. setpgid(0, 0);
  638.  
  639. if (script->flags & SC_EXECABLE) {
  640. - /* If keepalived dies, we want the script to die */
  641. - prctl(PR_SET_PDEATHSIG, SIGTERM);
  642. -
  643. execve(script->args[0], script->args, environ);
  644.  
  645. /* error */
  646. --- lib/scheduler.c.orig 2018-06-22 05:03:20.622974000 +0000
  647. +++ lib/scheduler.c 2018-06-22 05:04:32.956661000 +0000
  648. @@ -51,7 +51,6 @@
  649. #include "bitops.h"
  650. #include "git-commit.h"
  651. #include <sys/utsname.h>
  652. -#include <linux/version.h>
  653.  
  654. /* global vars */
  655. thread_master_t *master = NULL;
  656. @@ -297,10 +296,6 @@ report_child_status(int status, pid_t pi
  657. "", ""
  658. #endif
  659. );
  660. - log_message(LOG_INFO, " Built with kernel headers for Linux %d.%d.%d",
  661. - (LINUX_VERSION_CODE >> 16) & 0xff,
  662. - (LINUX_VERSION_CODE >> 8) & 0xff,
  663. - (LINUX_VERSION_CODE ) & 0xff);
  664. uname(&uname_buf);
  665. log_message(LOG_INFO, " Running on %s %s %s", uname_buf.sysname, uname_buf.release, uname_buf.version);
  666. log_options("configure options", KEEPALIVED_CONFIGURE_OPTIONS);
  667. --- lib/parser.c.orig 2018-06-22 05:14:35.174543000 +0000
  668. +++ lib/parser.c 2018-06-22 05:15:22.254116000 +0000
  669. @@ -34,7 +34,6 @@
  670. #include <stdlib.h>
  671. #include <ctype.h>
  672. #include <stdbool.h>
  673. -#include <linux/version.h>
  674. #include <pwd.h>
  675. #include <ctype.h>
  676.  
  677. @@ -505,9 +504,6 @@ read_conf_file(const char *conf_file)
  678. even though testing on Linux 3.1 shows it appears to work. To be safe, don't
  679. use it until Linux 3.5. */
  680. curdir_fd = open(".", O_RDONLY | O_DIRECTORY
  681. -#if HAVE_DECL_O_PATH && LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
  682. - | O_PATH
  683. -#endif
  684. );
  685.  
  686. char *confpath = strdup(globbuf.gl_pathv[i]);
Add Comment
Please, Sign In to add comment