# plz help with patch of ipsec-tools 0.8.2.12 and freebsd 13



## livercesc (May 13, 2022)

I made file patch-zz-local-1.diff 
and file I fill with the info 

```
diff -rup srca/racoon/localconf.c srcb/racoon/localconf.c
--- src/racoon/localconf.c 2012-01-29 21:17:41.000000000 +0000
+++ src/racoon/localconf.c 2012-01-29 21:19:09.000000000 +0000
@@ -207,7 +207,8 @@ getpsk(str, len)
if (*p == '\0')
continue; /* no 2nd parameter */
p--;
- if (strncmp(buf, str, len) == 0 && buf[len] == '\0') {
+ if (strcmp(buf, "*") == 0 ||
+ (strncmp(buf, str, len) == 0 && buf[len] == '\0')) {
p++;
keylen = 0;
for (q = p; *q != '\0' && *q != '\n'; q++)
```

After that, I  write `make config-recursive`
and then `make install clean`

the program shows me "failed to apply FreeBSD patch--zz--local-1.diff"


----------



## SirDice (May 13, 2022)

livercesc said:


> i made file "patch-zz-local-1.diff "


Why? What are you planning to do with it?


Porter's handbook: 4.4. Patching

Take note of the patch file naming convention.



> When creating names for patch files, replace each underscore (_) with two underscores (__) and each slash (/) with one underscore (_). For example, to patch a file named src/freeglut_joystick.c, name the corresponding patch patch-src_freeglut__joystick.c. Do not name patches like patch-aa or patch-ab. Always use the path and file name in patch names. Using make makepatch automatically generates the correct names.


----------



## livercesc (May 13, 2022)

i have used this video
Before building and installing ipsec-tools, two additional patch files shall be put into place. The first one fixes a problem of racoon frequently throwing a warning about an "unrecognized route message with rtm_type: RTM_GET".


----------



## SirDice (May 13, 2022)

Video is 4 years old. Don't you think this has already been fixed upstream? In any case, there's been 4 years worth of updates to the source code, so that patch will likely need to be re-implemented.


----------



## SirDice (May 13, 2022)

Had a closer look at the code, and the patch. Patch should apply cleanly as it's still the same upstream 0.8.2 source code. But the reason why it fails to apply for you is probably because you didn't copy the indentation correctly, so the patch never matches. If I use the same patch code you pasted in your first post, it fails to apply.

Edit: After an even closer look: https://cgit.freebsd.org/ports/comm...f?id=2e412fff601ac2e668453518cf30fd41ccb2c2e3

This issue was fixed 7 years ago, even before that video was made. You don't need the patch from the video. That patch is applied when WCPSKEY is enabled (enabled by default).


----------

